-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix as_strided
for inputs smaller than the arguments specification.
#5914
Conversation
lol do you mind resolve the conflict? |
f9958ef
to
e66a809
Compare
@JackCaoG I think this is ready for another round of reviews. Could you take a look at it? |
const at::Tensor& GetRootBase(const at::Tensor& tensor); | ||
// Sets the base tensor of a given XLATensor. Convenient function | ||
// to be used when returning tensors. | ||
XLATensorPtr SetBaseTensor(XLATensorPtr tensor, const at::Tensor& base); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we ever expect base to be on non-xla device? If not can we add an explict check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I don't think so, since we got to a XLA dispatched kernel. Will add the check.
…pytorch#5914) * Add test. * Create `base_` tensor for views. * Use base tensor in `as_strided` operation. * Set base tensor of `as_strided`. * Fix lint errors. * Fix for disabled functionalization. * Address review.
…pytorch#5914) * Add test. * Create `base_` tensor for views. * Use base tensor in `as_strided` operation. * Set base tensor of `as_strided`. * Fix lint errors. * Fix for disabled functionalization. * Address review.
…pytorch#5914) * Add test. * Create `base_` tensor for views. * Use base tensor in `as_strided` operation. * Set base tensor of `as_strided`. * Fix lint errors. * Fix for disabled functionalization. * Address review.
…#5914) * Add test. * Create `base_` tensor for views. * Use base tensor in `as_strided` operation. * Set base tensor of `as_strided`. * Fix lint errors. * Fix for disabled functionalization. * Address review.
…#5914) * Add test. * Create `base_` tensor for views. * Use base tensor in `as_strided` operation. * Set base tensor of `as_strided`. * Fix lint errors. * Fix for disabled functionalization. * Address review.
Fix: #5719
This PR introduces a
base_
attribute forXLATensor
. It keeps track of the tensor whose storage would be aliased by the outer tensor due to a view operation.