Use narrow over indexing in hadacore_transform to prep for ABI stable (#28756)

Signed-off-by: Jane Xu <janeyx@meta.com>
This commit is contained in:
Jane (Yuan) Xu 2025-11-15 04:10:15 -05:00 committed by GitHub
parent dd6ac1c2bb
commit 74b5267d3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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()) {