We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3066b03 commit 8dc5b49Copy full SHA for 8dc5b49
torch_xla/csrc/runtime/tensor_source.h
@@ -57,10 +57,12 @@ class AtenSource : public TensorSource {
57
// TODO(ysiraichi): check, first, if tensor lives in a device that the
58
// current PjRt client has access. If so, we don't need to go through the
59
// CPU.
60
+ // Set `copy` to false becuase torch can figure out if it needs to copy the
61
+ // data or not.
62
tensor_ = std::move(
63
tensor.to(at::TensorOptions().device(at::kCPU).dtype(target_torch_type),
64
/*non_blocking=*/false,
- /*copy=*/true, at::MemoryFormat::Contiguous));
65
+ /*copy=*/false, at::MemoryFormat::Contiguous));
66
}
67
68
const void* data() const override { return tensor_.const_data_ptr(); }
0 commit comments