Ejemplo n.º 1
0
inline void _appendData(ByteArray& str, THLongStorage* arg) {
  _appendType(str, RPCType::LONG_STORAGE);
  _appendScalar<char>(str, arg == NULL);
  if (!arg) return;
  _appendScalar<ptrdiff_t>(str, THLongStorage_size(arg));
  for (ptrdiff_t i = 0; i < THLongStorage_size(arg); i++)
    _appendScalar<int64_t>(str, THLongStorage_get(arg, i));
}
Ejemplo n.º 2
0
void THTensor_(init)(THTensor *self, THStorage *storage, long storageOffset, THLongStorage *size)
{
  THTensor_(init_raw)(self, storage, storageOffset,
                      (size ? THLongStorage_size(size) : 0), (size ? THLongStorage_data(size) : NULL));
}
Ejemplo n.º 3
0
void THTensor_(resize)(THTensor *self, THLongStorage *size)
{
  THTensor_(resize_raw)(self, (size ? THLongStorage_size(size) : 0), (size ? THLongStorage_data(size) : NULL));
}