Extend torch function support to ALL arguments, not just scalar type (but not insides of list)#145089
Extend torch function support to ALL arguments, not just scalar type (but not insides of list)#145089ezyang wants to merge 5 commits intogh/ezyang/3068/basefrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/145089
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit ac58da9 with merge base 2507ae6 ( UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
The specific problem relates to torch function redispatch. Consider the argument overload list for Tensor.set_: This says we attempt to resolve the Storage overload before the Tensor overload. When a Tensor has a So maybe we need some special case saying that if something is a Tensor, it doesn't match for non-Tensor arguments? Hmm... |
|
Sure I'm in no hurry for this to land, we can talk about the implications once you're back! |
|
We ballin' this |
albanD
left a comment
There was a problem hiding this comment.
yolo I guess? Not sure if we want more extensive testing for this..
| // that internally | ||
| if (check_has_torch_function(obj, /*ignore_mode*/ true) && | ||
| !THPVariable_Check(obj)) { | ||
| // tensor subclasses and unrelated objects with __torch_function__ |
There was a problem hiding this comment.
This needs updating as only non-subclass are caught here actually.
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…(but not insides of list) (pytorch#145089) Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: pytorch#145089 Approved by: https://github.com/albanD, https://github.com/zou3519
…(but not insides of list) (pytorch#145089) Signed-off-by: Edward Z. Yang <ezyang@meta.com> Pull Request resolved: pytorch#145089 Approved by: https://github.com/albanD, https://github.com/zou3519
Stack from ghstack (oldest at bottom):
Signed-off-by: Edward Z. Yang ezyang@meta.com
cc @albanD