/
usr
/
local
/
lib64
/
python3.6
/
site-packages
/
torch
/
include
/
ATen
/
/usr/local/lib64/python3.6/site-packages/torch/include/ATen
mkdir
upload
Name
Size
Mode
Actions
core/
-
0755
rm
cpu/
-
0755
rm
cuda/
-
0755
rm
cudnn/
-
0755
rm
detail/
-
0755
rm
hip/
-
0755
rm
native/
-
0755
rm
quantized/
-
0755
rm
AccumulateType.h
4438
0644
edit
dl
rm
ArrayRef.h
44
0644
edit
dl
rm
ATen.h
998
0644
edit
dl
rm
autocast_mode.h
6716
0644
edit
dl
rm
Backend.h
43
0644
edit
dl
rm
Backtrace.h
46
0644
edit
dl
rm
BatchedFallback.h
965
0644
edit
dl
rm
BatchedTensorImpl.h
5383
0644
edit
dl
rm
CompositeExplicitAutogradFunctions.h
1622
0644
edit
dl
rm
CompositeExplicitAutogradFunctions_inl.h
54075
0644
edit
dl
rm
CompositeImplicitAutogradFunctions.h
1622
0644
edit
dl
rm
CompositeImplicitAutogradFunctions_inl.h
142082
0644
edit
dl
rm
Config.h
734
0644
edit
dl
rm
Context.h
12767
0644
edit
dl
rm
cpp_custom_type_hack.h
5326
0644
edit
dl
rm
CPUApplyUtils.h
12582
0644
edit
dl
rm
CPUFixedAllocator.h
830
0644
edit
dl
rm
CPUFunctions.h
1600
0644
edit
dl
rm
CPUFunctions_inl.h
171924
0644
edit
dl
rm
CPUGeneratorImpl.h
1431
0644
edit
dl
rm
CUDAFunctions.h
1601
0644
edit
dl
rm
CUDAFunctions_inl.h
185696
0644
edit
dl
rm
CUDAGeneratorImpl.h
4695
0644
edit
dl
rm
Device.h
42
0644
edit
dl
rm
DeviceGuard.h
1134
0644
edit
dl
rm
Dimname.h
31
0644
edit
dl
rm
DimVector.h
46
0644
edit
dl
rm
Dispatch.h
52137
0644
edit
dl
rm
div_rtn.h
204
0644
edit
dl
rm
DLConvertor.h
576
0644
edit
dl
rm
dlpack.h
5244
0644
edit
dl
rm
DynamicLibrary.h
369
0644
edit
dl
rm
ExpandUtils.h
14506
0644
edit
dl
rm
Formatting.h
34
0644
edit
dl
rm
Functions.h
846326
0644
edit
dl
rm
Generator.h
46
0644
edit
dl
rm
InferSize.h
2143
0644
edit
dl
rm
InitialTensorOptions.h
445
0644
edit
dl
rm
Layout.h
42
0644
edit
dl
rm
MapAllocator.h
2999
0644
edit
dl
rm
MatrixRef.h
3016
0644
edit
dl
rm
MemoryOverlap.h
1117
0644
edit
dl
rm
MetaFunctions.h
1601
0644
edit
dl
rm
MetaFunctions_inl.h
84006
0644
edit
dl
rm
NamedTensor.h
35
0644
edit
dl
rm
NamedTensorUtils.h
5747
0644
edit
dl
rm
NativeFunctions.h
354651
0644
edit
dl
rm
NativeMetaFunctions.h
35445
0644
edit
dl
rm
NumericUtils.h
2787
0644
edit
dl
rm
OpaqueTensorImpl.h
6080
0644
edit
dl
rm
Operators.h
1707199
0644
edit
dl
rm
OpMathType.h
460
0644
edit
dl
rm
Parallel.h
4875
0644
edit
dl
rm
ParallelNative.h
2443
0644
edit
dl
rm
ParallelNativeTBB.h
2934
0644
edit
dl
rm
ParallelOpenMP.h
3049
0644
edit
dl
rm
PTThreadPool.h
394
0644
edit
dl
rm
record_function.h
24044
0644
edit
dl
rm
RedispatchFunctions.h
1112886
0644
edit
dl
rm
RegistrationDeclarations.h
545777
0644
edit
dl
rm
SavedTensorHooks.h
328
0644
edit
dl
rm
Scalar.h
44
0644
edit
dl
rm
ScalarOps.h
2272
0644
edit
dl
rm
ScalarType.h
129
0644
edit
dl
rm
SequenceNumber.h
373
0644
edit
dl
rm
SmallVector.h
47
0644
edit
dl
rm
SparseCsrTensorImpl.h
2045
0644
edit
dl
rm
SparseCsrTensorUtils.h
523
0644
edit
dl
rm
SparseTensorImpl.h
12417
0644
edit
dl
rm
SparseTensorUtils.h
4219
0644
edit
dl
rm
Storage.h
43
0644
edit
dl
rm
Tensor.h
48
0644
edit
dl
rm
TensorAccessor.h
51
0644
edit
dl
rm
TensorGeometry.h
1855
0644
edit
dl
rm
TensorIndexing.h
21923
0644
edit
dl
rm
TensorIterator.h
29962
0644
edit
dl
rm
TensorIteratorInternal.h
1862
0644
edit
dl
rm
TensorMeta.h
2917
0644
edit
dl
rm
TensorNames.h
2519
0644
edit
dl
rm
TensorOperators.h
3275
0644
edit
dl
rm
TensorOptions.h
49
0644
edit
dl
rm
TensorUtils.h
5687
0644
edit
dl
rm
ThreadLocalState.h
3289
0644
edit
dl
rm
TracerMode.h
5576
0644
edit
dl
rm
TypeDefault.h
680
0644
edit
dl
rm
Utils.h
5993
0644
edit
dl
rm
Version.h
340
0644
edit
dl
rm
VmapMode.h
952
0644
edit
dl
rm
VmapTransforms.h
7654
0644
edit
dl
rm
WrapDimUtils.h
3438
0644
edit
dl
rm
WrapDimUtilsMulti.h
768
0644
edit
dl
rm
Edit:
/usr/local/lib64/python3.6/site-packages/torch/include/ATen/TensorUtils.h
(5687B)
#pragma once #include <ATen/DimVector.h> #include <ATen/Tensor.h> #include <ATen/TensorGeometry.h> #include <ATen/Utils.h> // 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<TensorArg> 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<TensorArg> tensors); TORCH_API void checkScalarType( CheckedFrom c, const TensorArg& t, ScalarType s); TORCH_API void checkScalarTypes( CheckedFrom c, const TensorArg& t, at::ArrayRef<ScalarType> l); TORCH_API void checkSameGPU( CheckedFrom c, const TensorArg& t1, const TensorArg& t2); TORCH_API void checkAllSameGPU(CheckedFrom c, ArrayRef<TensorArg> tensors); TORCH_API void checkSameType( CheckedFrom c, const TensorArg& t1, const TensorArg& t2); TORCH_API void checkAllSameType(CheckedFrom c, ArrayRef<TensorArg> 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<TensorArg> t); // FixMe: does TensorArg slow things down? TORCH_API void checkBackend( CheckedFrom c, at::ArrayRef<Tensor> t, at::Backend backend); TORCH_API void checkDeviceType( CheckedFrom c, at::ArrayRef<Tensor> tensors, at::DeviceType device_type); TORCH_API void checkLayout(CheckedFrom c, const Tensor& t, Layout layout); TORCH_API void checkLayout(CheckedFrom c, at::ArrayRef<Tensor> 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<int64_t> defaultStrides(IntArrayRef sizes); TORCH_API size_t computeStorageNbytes(IntArrayRef sizes, IntArrayRef strides, size_t itemsize); TORCH_API c10::optional<std::vector<int64_t>> computeStride( IntArrayRef oldshape, IntArrayRef oldstride, IntArrayRef newshape); TORCH_API c10::optional<DimVector> computeStride( IntArrayRef oldshape, IntArrayRef oldstride, const DimVector& newshape); } // namespace detail } // namespace at
Save
cmd:
run