-
Notifications
You must be signed in to change notification settings - Fork 26.3k
[jit] fix optional type subtype relation #22186
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
Conversation
[jit] fix optional type subtype relation gh-metadata: pytorch pytorch 22186 gh/wanchaol/26/head
aten/src/ATen/core/jit_type.h
Outdated
| bool operator==(const Type& rhs) const override { | ||
| if (auto opt_rhs = rhs.cast<OptionalType>()) { | ||
| return getElementType()->isSubtypeOf(opt_rhs->getElementType()); | ||
| return getElementType() == opt_rhs->getElementType(); |
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.
ah I was looking at this and thinking the operator looked wrong. I tried changing it to this locally but it didn't fix my issue -- didn't realize we'd need the new isSubtypeOf as well to get it to work.
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.
Yup I think the isSubtypeOf will fix your problem
[jit] fix optional type subtype relation gh-metadata: pytorch pytorch 22186 gh/wanchaol/26/head
…x optional type subtype relation" [jit] fix optional type subtype relation gh-metadata: pytorch pytorch 22186 gh/wanchaol/26/head
Summary: Pull Request resolved: pytorch/pytorch#22186 ghimport-source-id: 05ef8c3a176fe2a67d4835888e6db52b57a6d199 Test Plan: Imported from OSS Differential Revision: D15994644 Pulled By: wanchaol fbshipit-source-id: 7c5c4eebd421f6c9470661c2c2eb38bafdff8bbd
Stack from ghstack:
Differential Revision: D15994644