You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The dtype promotion check in _fix_promotion does not correctly identify scalar inputs, and unconditionally accesses .dtype.
This breaks binary operators with float scalar inputs.
The can be fixed by accessing dtype via getattr with a None default or validating that the input is not a scalar.
Happy to provide a PR.
Somehow missed this issue. Python scalar inputs are portable in the standard, but we should still make them work if they work with the upstream functions.
asmeurer
added a commit
to asmeurer/array-api-compat
that referenced
this issue
Mar 8, 2024
The dtype promotion check in
_fix_promotion
does not correctly identify scalar inputs, and unconditionally accesses.dtype
.This breaks binary operators with
float
scalar inputs.The can be fixed by accessing dtype via
getattr
with aNone
default or validating that the input is not a scalar.Happy to provide a PR.
Minimal repo, in version 1.4, via:
Raises:
Would expect equivalent behavior to
torch.add
.See:
https://gist.github.com/asford/ee688d59f0747a6507b9670a83fa7c47
The text was updated successfully, but these errors were encountered: