diff --git a/torch_npu/csrc/aten/common/TensorProperties.cpp b/torch_npu/csrc/aten/common/TensorProperties.cpp index bf2abb3750d83d2b9111c59dfd872bb6928497f6..878a74a6bb930aec29aef1ee790d927658289553 100644 --- a/torch_npu/csrc/aten/common/TensorProperties.cpp +++ b/torch_npu/csrc/aten/common/TensorProperties.cpp @@ -16,17 +16,12 @@ #include #include "torch_npu/csrc/aten/common/InnerNpuNativeFunction.h" +#include "torch_npu/csrc/aten/NPUNativeFunctions.h" namespace at_npu { namespace native { -at::Tensor contiguous_npu(const at::Tensor& self, c10::MemoryFormat memory_format); - -at::Tensor contiguous_npu(const at::Tensor & self) { - return contiguous_npu(self, c10::MemoryFormat::Contiguous); -} - -at::Tensor contiguous_npu(const at::Tensor& self, c10::MemoryFormat memory_format) { +at::Tensor NPUNativeFunctions::contiguous(const at::Tensor& self, c10::MemoryFormat memory_format) { if (self.is_contiguous(memory_format)) { return self; } @@ -34,7 +29,6 @@ at::Tensor contiguous_npu(const at::Tensor& self, c10::MemoryFormat memory_forma TORCH_CHECK( memory_format != c10::MemoryFormat::Preserve, "preserve memory format is unsupported by the contiguous operator"); - return self.clone(); }