diff --git a/csrc/quantization/hadamard/hadacore/hadamard_transform_cuda.cu b/csrc/quantization/hadamard/hadacore/hadamard_transform_cuda.cu index 5369d409f9b2..aff11326d78e 100644 --- a/csrc/quantization/hadamard/hadacore/hadamard_transform_cuda.cu +++ b/csrc/quantization/hadamard/hadacore/hadamard_transform_cuda.cu @@ -802,7 +802,7 @@ torch::Tensor hadacore_transform(torch::Tensor& x, bool inplace) { }); if (numel % 256 != 0) { - out = out.index({torch::indexing::Slice(0, numel / had_size)}); + out = out.narrow(0, 0, numel / had_size); } if (inplace && out.data_ptr() != x.data_ptr()) {