pytorch tensor存储理解 发表于 2018-09-Thu | 阅读次数: 一层集装箱,每个集装箱里面装了物体, 如果一层的物体的stride是一样的,那么就合并成一个。12345678910typedef struct THStorage{ real *data; ptrdiff_t size; int refcount; char flag; THAllocator *allocator; void *allocatorContext; struct THStorage *view;} THStorage;12345678910111213typedef struct THTensor{ int64_t *size; // 注意是指针 int64_t *stride; // 注意是指针 int nDimension; // Note: storage->size may be greater than the recorded size // of a tensor THStorage *storage; ptrdiff_t storageOffset; int refcount; char flag;} THTensor;请作者喝一杯咖啡☕️打赏微信支付