-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Only do meta registrations if we have the ops #7500
Conversation
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/7500
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 FailuresAs of commit 7a58ba1: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
One Q below but LGTM (after lint job is fixed), thanks @ezyang
torchvision/_meta_registrations.py
Outdated
|
||
def register_meta(op): | ||
def wrapper(fn): | ||
_meta_lib.impl(op, fn) |
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.
I assume it wouldn't be enough to only put the if torchvision.extension._has_ops():
block as below? (instead of protecting the entire file in the if...
block)
_meta_lib.impl(op, fn) | |
if torchvision.extension._has_ops(): | |
_meta_lib.impl(op, fn) |
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.
Unfortunately not, because I directly access torch.ops.torchvision to program the decorator. I guess I could stringify register_meta to avoid this.
OK, did a stringy strategy |
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Hey @ezyang! You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py |
Summary: Signed-off-by: Edward Z. Yang <ezyang@meta.com> Reviewed By: vmoens Differential Revision: D45183661 fbshipit-source-id: 808a5d461b4217e7a00295675311fedd99e3d23a
Fixes #7472
Signed-off-by: Edward Z. Yang ezyang@meta.com