pytorch
ac8c6d09 - Don't check overflow for scalar arg in comparison ops (#78881)

Commit
2 years ago
Don't check overflow for scalar arg in comparison ops (#78881) That check was potentially synchronizing (people were running into synchronization in real workloads) and mostly unneeded. Type promotion takes care of comparing to values that cannot be safely converted to the type of other argument. This now works for `comp(int_tensor, float('inf'))` as expected. For `comp(uint8_tensor, large_int)` it silently wraps integer to uint8 whereas it would error out before, but this also happens with other arithmetic ops. Also adds reference np implementation to comparison op OpInfos, and additional reference inputs to test newly enabled behavior. Fixes #76805 Pull Request resolved: https://github.com/pytorch/pytorch/pull/78881 Approved by: https://github.com/mruberry
Author
Natalia Gimelshein
Committer
Parents
Loading