Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions torch_xla/csrc/tensor_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@ XLATensorImpl::XLATensorImpl(XLATensor tensor)
SetupSizeProperties();
}

c10::intrusive_ptr<c10::TensorImpl> XLATensorImpl::shallow_copy_and_detach()
const {
c10::intrusive_ptr<c10::TensorImpl> XLATensorImpl::shallow_copy_and_detach(
const c10::VariableVersion& version_counter,
bool allow_tensor_metadata_change) const {
auto impl = c10::make_intrusive<XLATensorImpl>(tensor_);
impl->is_wrapped_number_ = is_wrapped_number_;
impl->reserved_ = reserved_;
impl->set_version_counter(version_counter);
impl->set_allow_tensor_metadata_change(allow_tensor_metadata_change);
return impl;
}

Expand Down
4 changes: 3 additions & 1 deletion torch_xla/csrc/tensor_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class XLATensorImpl : public c10::TensorImpl {

XLATensor& tensor() { return tensor_; }

c10::intrusive_ptr<c10::TensorImpl> shallow_copy_and_detach() const override;
c10::intrusive_ptr<TensorImpl> shallow_copy_and_detach(
const c10::VariableVersion& version_counter,
bool allow_tensor_metadata_change) const override;

at::IntArrayRef sizes() const override;

Expand Down