Refactor to reduce duplicate logic in torch._ops#96302
Refactor to reduce duplicate logic in torch._ops#96302ezyang wants to merge 4 commits intogh/ezyang/1892/basefrom
Conversation
Signed-off-by: Edward Z. Yang <[email protected]> [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/96302
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 23a2bd7: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
zou3519
left a comment
There was a problem hiding this comment.
Cool!
type hints and lint warnings are real
| # NB: This name is hard-coded in torch/csrc/autograd/python_variable.cpp | ||
| # for use with OpOverload; cache lookup is done entirely from C++ | ||
| # for speed. | ||
| # TODO: The cache is NOT currently used by PyOperator, but it should! |
There was a problem hiding this comment.
nit: file issue when you merge this?
There was a problem hiding this comment.
This is fixed later in the stack!
|
|
||
| def py_impl(self, dispatch_key, fn): | ||
| pass | ||
| def py_impl(self, k): |
There was a problem hiding this comment.
nit: k -> key for readability? Though i guess it's not really a key anymore, it's either a key, python mode, or a transform type
There was a problem hiding this comment.
Yeah, the old name was really long and so I figured let's just use a short meaningless identifier
Signed-off-by: Edward Z. Yang <ezyangmeta.com> [ghstack-poisoned]
Signed-off-by: Edward Z. Yang <[email protected]> Pull Request resolved: pytorch/pytorch#96302 Approved by: https://github.com/zou3519
Signed-off-by: Edward Z. Yang <[email protected]> Pull Request resolved: pytorch/pytorch#96302 Approved by: https://github.com/zou3519
Signed-off-by: Edward Z. Yang <[email protected]> Pull Request resolved: pytorch#96302 Approved by: https://github.com/zou3519
Stack from ghstack (oldest at bottom):
Signed-off-by: Edward Z. Yang [email protected]