/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
torch
/
include
/
TH
/
generic
/
/usr/local/lib64/python3.6/site-packages/torch/include/TH/generic
mkdir
upload
Name
Size
Mode
Actions
THStorage.h
2716
0644
edit
dl
rm
THStorageCopy.h
1750
0644
edit
dl
rm
THTensor.h
3240
0644
edit
dl
rm
THTensor.hpp
559
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/torch/include/TH/generic/THTensor.h
(3240B)
#ifndef TH_GENERIC_FILE #define TH_GENERIC_FILE "TH/generic/THTensor.h" #else /* a la lua? dim, storageoffset, ... et les methodes ? */ #include <c10/core/TensorImpl.h> #define THTensor at::TensorImpl // These used to be distinct types; for some measure of backwards compatibility and documentation // alias these to the single THTensor type. #define THFloatTensor THTensor #define THDoubleTensor THTensor #define THHalfTensor THTensor #define THByteTensor THTensor #define THCharTensor THTensor #define THShortTensor THTensor #define THIntTensor THTensor #define THLongTensor THTensor #define THBoolTensor THTensor #define THBFloat16Tensor THTensor #define THComplexFloatTensor THTensor #define THComplexDoubleTensor THTensor /**** access methods ****/ TH_API THStorage* THTensor_(storage)(const THTensor *self); TH_API ptrdiff_t THTensor_(storageOffset)(const THTensor *self); // See [NOTE: nDimension vs nDimensionLegacyNoScalars vs nDimensionLegacyAll] TH_API int THTensor_(nDimension)(const THTensor *self); TH_API int THTensor_(nDimensionLegacyNoScalars)(const THTensor *self); TH_API int THTensor_(nDimensionLegacyAll)(const THTensor *self); TH_API int64_t THTensor_(size)(const THTensor *self, int dim); TH_API int64_t THTensor_(stride)(const THTensor *self, int dim); TH_API scalar_t *THTensor_(data)(const THTensor *self); /**** creation methods ****/ TH_API THTensor *THTensor_(new)(void); TH_API THTensor *THTensor_(newWithTensor)(THTensor *tensor); TH_API THTensor *THTensor_(newWithStorage1d)(THStorage *storage_, ptrdiff_t storageOffset_, int64_t size0_, int64_t stride0_); /* stride might be NULL */ TH_API THTensor *THTensor_(newWithSize1d)(int64_t size0_); TH_API THTensor *THTensor_(newClone)(THTensor *self); TH_API THTensor *THTensor_(newContiguous)(THTensor *tensor); TH_API THTensor *THTensor_(newSelect)(THTensor *tensor, int dimension_, int64_t sliceIndex_); TH_API THTensor *THTensor_(newNarrow)(THTensor *tensor, int dimension_, int64_t firstIndex_, int64_t size_); TH_API THTensor *THTensor_(newTranspose)(THTensor *tensor, int dimension1_, int dimension2_); // resize* methods simply resize the storage. So they may not retain the current data at current indices. // This is especially likely to happen when the tensor is not contiguous. In general, if you still need the // values, unless you are doing some size and stride tricks, do not use resize*. TH_API void THTensor_(resizeNd)(THTensor *tensor, int nDimension, const int64_t *size, const int64_t *stride); // Note: these are legacy resize functions that treat sizes as size->size() == 0 and size->data<int64_t>() as being 0-terminated. TH_API void THTensor_(set)(THTensor *self, THTensor *src); TH_API void THTensor_(narrow)(THTensor *self, THTensor *src, int dimension_, int64_t firstIndex_, int64_t size_); TH_API void THTensor_(select)(THTensor *self, THTensor *src, int dimension_, int64_t sliceIndex_); TH_API int THTensor_(isContiguous)(const THTensor *self); TH_API int THTensor_(isSameSizeAs)(const THTensor *self, const THTensor *src); TH_API ptrdiff_t THTensor_(nElement)(const THTensor *self); TH_API void THTensor_(retain)(THTensor *self); TH_API void THTensor_(free)(THTensor *self); #endif
Save
cmd:
run