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 0ee876f commit efdf117Copy full SHA for efdf117
torch_xla/csrc/runtime/tensor_source.h
@@ -57,12 +57,10 @@ 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,
65
- /*copy=*/false, at::MemoryFormat::Contiguous));
+ /*copy=*/true, at::MemoryFormat::Contiguous));
66
}
67
68
const void* data() const override { return tensor_.const_data_ptr(); }
0 commit comments