-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[pt2] bug fix: invert condition in checkFloatingOrComplex
#102944
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
[ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/102944
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit d266966: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| if not allow_low_precision_dtypes: | ||
| torch._check( | ||
| dtype in (torch.float, torch.double, torch.cfloat, torch.cdouble), | ||
| lambda: f"{f_name}: Low precision dtypes not supported. Got {dtype}", |
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.
CPP code:
static inline void checkFloatingOrComplex(const Tensor& t, const char* const f_name, const bool allow_low_precision_dtypes=true) {
auto dtype = t.scalar_type();
TORCH_CHECK((at::isFloatingType(dtype) || at::isComplexType(dtype)),
f_name, ": Expected a floating point or complex tensor as input. Got ", dtype);
if (!allow_low_precision_dtypes) { // <--------- here
TORCH_CHECK(dtype == kFloat || dtype == kDouble || dtype == kComplexFloat || dtype == kComplexDouble,
f_name, ": Low precision dtypes not supported. Got ", dtype);
}
}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.
Approving to move forward, but can you add an error sample to one of the linalg ops to make sure we're testing this?
[ghstack-poisoned]
|
Note: waiting until #103240 lands (again) before I rebase this and merge. UPD: Decided to land this first if possible. Looks like the PR I'm referencing here is not reviewed and has some failures. |
[ghstack-poisoned]
Stack from ghstack:
SymIntsupport forlinalg_matrix_exp#102945checkFloatingOrComplex#102944