You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should make sure all PyTorch operations are "Composite Compliant". This condition is necessary for operators that look out-of-place to preserve the Tensor Subclass when passed in a Tensor Subclass.
Consider the following hypothetical out-of-place operation:
def my_add(x, y):
result = x.clone()
result.add_(y)
return result
You may expect this to work the same as torch.add. However, if x is not a Tensor Subclass, but y is a Tensor subclass, then this returns us a regular Tensor, NOT a Tensor subclass!
The text was updated successfully, but these errors were encountered:
Aka, pytorch/pytorch#69991
Motivation
We should make sure all PyTorch operations are "Composite Compliant". This condition is necessary for operators that look out-of-place to preserve the Tensor Subclass when passed in a Tensor Subclass.
Consider the following hypothetical out-of-place operation:
You may expect this to work the same as torch.add. However, if x is not a Tensor Subclass, but y is a Tensor subclass, then this returns us a regular Tensor, NOT a Tensor subclass!
The text was updated successfully, but these errors were encountered: