/usr/local/lib64/python3.6/site-packages/torch/include/ATen
NameSizeModeActions
core/-0755rm
cpu/-0755rm
cuda/-0755rm
cudnn/-0755rm
detail/-0755rm
hip/-0755rm
native/-0755rm
quantized/-0755rm
AccumulateType.h44380644editdlrm
ArrayRef.h440644editdlrm
ATen.h9980644editdlrm
autocast_mode.h67160644editdlrm
Backend.h430644editdlrm
Backtrace.h460644editdlrm
BatchedFallback.h9650644editdlrm
BatchedTensorImpl.h53830644editdlrm
CompositeExplicitAutogradFunctions.h16220644editdlrm
CompositeExplicitAutogradFunctions_inl.h540750644editdlrm
CompositeImplicitAutogradFunctions.h16220644editdlrm
CompositeImplicitAutogradFunctions_inl.h1420820644editdlrm
Config.h7340644editdlrm
Context.h127670644editdlrm
cpp_custom_type_hack.h53260644editdlrm
CPUApplyUtils.h125820644editdlrm
CPUFixedAllocator.h8300644editdlrm
CPUFunctions.h16000644editdlrm
CPUFunctions_inl.h1719240644editdlrm
CPUGeneratorImpl.h14310644editdlrm
CUDAFunctions.h16010644editdlrm
CUDAFunctions_inl.h1856960644editdlrm
CUDAGeneratorImpl.h46950644editdlrm
Device.h420644editdlrm
DeviceGuard.h11340644editdlrm
Dimname.h310644editdlrm
DimVector.h460644editdlrm
Dispatch.h521370644editdlrm
div_rtn.h2040644editdlrm
DLConvertor.h5760644editdlrm
dlpack.h52440644editdlrm
DynamicLibrary.h3690644editdlrm
ExpandUtils.h145060644editdlrm
Formatting.h340644editdlrm
Functions.h8463260644editdlrm
Generator.h460644editdlrm
InferSize.h21430644editdlrm
InitialTensorOptions.h4450644editdlrm
Layout.h420644editdlrm
MapAllocator.h29990644editdlrm
MatrixRef.h30160644editdlrm
MemoryOverlap.h11170644editdlrm
MetaFunctions.h16010644editdlrm
MetaFunctions_inl.h840060644editdlrm
NamedTensor.h350644editdlrm
NamedTensorUtils.h57470644editdlrm
NativeFunctions.h3546510644editdlrm
NativeMetaFunctions.h354450644editdlrm
NumericUtils.h27870644editdlrm
OpaqueTensorImpl.h60800644editdlrm
Operators.h17071990644editdlrm
OpMathType.h4600644editdlrm
Parallel.h48750644editdlrm
ParallelNative.h24430644editdlrm
ParallelNativeTBB.h29340644editdlrm
ParallelOpenMP.h30490644editdlrm
PTThreadPool.h3940644editdlrm
record_function.h240440644editdlrm
RedispatchFunctions.h11128860644editdlrm
RegistrationDeclarations.h5457770644editdlrm
SavedTensorHooks.h3280644editdlrm
Scalar.h440644editdlrm
ScalarOps.h22720644editdlrm
ScalarType.h1290644editdlrm
SequenceNumber.h3730644editdlrm
SmallVector.h470644editdlrm
SparseCsrTensorImpl.h20450644editdlrm
SparseCsrTensorUtils.h5230644editdlrm
SparseTensorImpl.h124170644editdlrm
SparseTensorUtils.h42190644editdlrm
Storage.h430644editdlrm
Tensor.h480644editdlrm
TensorAccessor.h510644editdlrm
TensorGeometry.h18550644editdlrm
TensorIndexing.h219230644editdlrm
TensorIterator.h299620644editdlrm
TensorIteratorInternal.h18620644editdlrm
TensorMeta.h29170644editdlrm
TensorNames.h25190644editdlrm
TensorOperators.h32750644editdlrm
TensorOptions.h490644editdlrm
TensorUtils.h56870644editdlrm
ThreadLocalState.h32890644editdlrm
TracerMode.h55760644editdlrm
TypeDefault.h6800644editdlrm
Utils.h59930644editdlrm
Version.h3400644editdlrm
VmapMode.h9520644editdlrm
VmapTransforms.h76540644editdlrm
WrapDimUtils.h34380644editdlrm
WrapDimUtilsMulti.h7680644editdlrm
Edit: /usr/local/lib64/python3.6/site-packages/torch/include/ATen/TensorUtils.h (5687B)
#pragma once #include #include #include #include // These functions are NOT in Utils.h, because this file has a dep on Tensor.h namespace at { // The following are utility functions for checking that arguments // make sense. These are particularly useful for native functions, // which do NO argument checking by default. struct TORCH_API TensorArg { const Tensor& tensor; const char* name; int pos; // 1-indexed TensorArg(const Tensor& tensor, const char* name, int pos) : tensor(tensor), name(name), pos(pos) {} // Try to mitigate any possibility of dangling reference to temporaries. TensorArg(Tensor&& tensor, const char* name, int pos) = delete; const Tensor* operator->() const { return &tensor; } const Tensor& operator*() const { return tensor; } }; struct TORCH_API TensorGeometryArg { TensorGeometry tensor; const char* name; int pos; // 1-indexed /* implicit */ TensorGeometryArg(TensorArg arg) : tensor(TensorGeometry{arg.tensor}), name(arg.name), pos(arg.pos) {} TensorGeometryArg(TensorGeometry tensor, const char* name, int pos) : tensor(tensor), name(name), pos(pos) {} const TensorGeometry* operator->() const { return &tensor; } const TensorGeometry& operator*() const { return tensor; } }; // A string describing which function did checks on its input // arguments. // TODO: Consider generalizing this into a call stack. using CheckedFrom = const char*; // The undefined convention: singular operators assume their arguments // are defined, but functions which take multiple tensors will // implicitly filter out undefined tensors (to make it easier to perform // tests which should apply if the tensor is defined, and should not // otherwise.) // // NB: This means that the n-ary operators take lists of TensorArg, // not TensorGeometryArg, because the Tensor to TensorGeometry // conversion will blow up if you have undefined tensors. TORCH_API std::ostream& operator<<(std::ostream& out, TensorGeometryArg t); TORCH_API void checkDim( CheckedFrom c, const Tensor& tensor, const char* name, int pos, // 1-indexed int64_t dim); TORCH_API void checkDim( CheckedFrom c, const TensorGeometryArg& t, int64_t dim); // NB: this is an inclusive-exclusive range TORCH_API void checkDimRange( CheckedFrom c, const TensorGeometryArg& t, int64_t dim_start, int64_t dim_end); TORCH_API void checkSameDim( CheckedFrom c, const TensorGeometryArg& t1, const TensorGeometryArg& t2); TORCH_API void checkContiguous(CheckedFrom c, const TensorGeometryArg& t); TORCH_API void checkAllContiguous(CheckedFrom c, at::ArrayRef ts); TORCH_API void checkSize( CheckedFrom c, const TensorGeometryArg& t, IntArrayRef sizes); TORCH_API void checkSize( CheckedFrom c, const TensorGeometryArg& t, int64_t dim, int64_t size); TORCH_API void checkNumel( CheckedFrom c, const TensorGeometryArg& t, int64_t numel); TORCH_API void checkSameNumel( CheckedFrom c, const TensorGeometryArg& t1, const TensorGeometryArg& t2); TORCH_API void checkAllSameNumel(CheckedFrom c, ArrayRef tensors); TORCH_API void checkScalarType( CheckedFrom c, const TensorArg& t, ScalarType s); TORCH_API void checkScalarTypes( CheckedFrom c, const TensorArg& t, at::ArrayRef l); TORCH_API void checkSameGPU( CheckedFrom c, const TensorArg& t1, const TensorArg& t2); TORCH_API void checkAllSameGPU(CheckedFrom c, ArrayRef tensors); TORCH_API void checkSameType( CheckedFrom c, const TensorArg& t1, const TensorArg& t2); TORCH_API void checkAllSameType(CheckedFrom c, ArrayRef tensors); TORCH_API void checkSameSize( CheckedFrom c, const TensorArg& t1, const TensorArg& t2); TORCH_API void checkDefined(CheckedFrom c, const TensorArg& t); TORCH_API void checkAllDefined(CheckedFrom c, at::ArrayRef t); // FixMe: does TensorArg slow things down? TORCH_API void checkBackend( CheckedFrom c, at::ArrayRef t, at::Backend backend); TORCH_API void checkDeviceType( CheckedFrom c, at::ArrayRef tensors, at::DeviceType device_type); TORCH_API void checkLayout(CheckedFrom c, const Tensor& t, Layout layout); TORCH_API void checkLayout(CheckedFrom c, at::ArrayRef tensors, at::Layout layout); // Methods for getting data_ptr if tensor is defined TORCH_API void* maybe_data_ptr(const Tensor& tensor); TORCH_API void* maybe_data_ptr(const TensorArg& tensor); // Return if the tensor geometry represented by `sizes` and `strides` is contiguous // Although we cache is_contiguous in tensor now, this is till useful because it // allows checking if a particular geometry is contiguous without explicitly // constructing a tensor, e.g., when you want to choose a kernel strategy based // on whether a subgeometry is contiguous. TORCH_API bool geometry_is_contiguous(IntArrayRef sizes, IntArrayRef strides); TORCH_API void check_dim_size( const Tensor& tensor, int64_t dim, int64_t dim_size, int64_t size); namespace detail { TORCH_API std::vector defaultStrides(IntArrayRef sizes); TORCH_API size_t computeStorageNbytes(IntArrayRef sizes, IntArrayRef strides, size_t itemsize); TORCH_API c10::optional> computeStride( IntArrayRef oldshape, IntArrayRef oldstride, IntArrayRef newshape); TORCH_API c10::optional computeStride( IntArrayRef oldshape, IntArrayRef oldstride, const DimVector& newshape); } // namespace detail } // namespace at