1 #include <vector> 2 3 #include <torch/csrc/lazy/core/tensor_util.h> 4 #include <torch/csrc/lazy/core/util.h> 5 6 namespace torch { 7 namespace lazy { 8 9 TORCH_API bool StrideIsSupported(c10::ArrayRef<int64_t> stride); 10 11 TORCH_API std::vector<int64_t> GetArrayStridePermutation( 12 c10::ArrayRef<int64_t> stride); 13 14 TORCH_API Shape MakeDiagonalShape( 15 const Shape& shape, 16 int64_t offset, 17 int64_t dim1, 18 int64_t dim2); 19 20 TORCH_API Shape 21 MakePermuteShape(const Shape& source_shape, c10::ArrayRef<int64_t> permutation); 22 23 TORCH_API Shape MakeSelectShape( 24 const Shape& shape, 25 int64_t dim, 26 int64_t start, 27 int64_t end, 28 int64_t stride); 29 30 TORCH_API int64_t GetStride(int64_t start, int64_t end, int64_t stride); 31 32 TORCH_API std::vector<int64_t> BuildSqueezedDimensions( 33 c10::ArrayRef<int64_t> dimensions, 34 int64_t squeeze_dim); 35 36 TORCH_API std::vector<int64_t> BuildUnsqueezedDimensions( 37 c10::ArrayRef<int64_t> dimensions, 38 int64_t squeeze_dim); 39 40 } // namespace lazy 41 } // namespace torch 42