Skip to content

Commit efdf117

Browse files
authored
Revert "Avoid unnecessary copy in TensorSource (#8849)" (#9379)
1 parent 0ee876f commit efdf117

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

torch_xla/csrc/runtime/tensor_source.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,10 @@ class AtenSource : public TensorSource {
5757
// TODO(ysiraichi): check, first, if tensor lives in a device that the
5858
// current PjRt client has access. If so, we don't need to go through the
5959
// CPU.
60-
// Set `copy` to false becuase torch can figure out if it needs to copy the
61-
// data or not.
6260
tensor_ = std::move(
6361
tensor.to(at::TensorOptions().device(at::kCPU).dtype(target_torch_type),
6462
/*non_blocking=*/false,
65-
/*copy=*/false, at::MemoryFormat::Contiguous));
63+
/*copy=*/true, at::MemoryFormat::Contiguous));
6664
}
6765

6866
const void* data() const override { return tensor_.const_data_ptr(); }

0 commit comments

Comments
 (0)