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
{{ message }}
Repository navigation
torch binary operations broken for scalar inputs in _fix_promotion #85
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.
Activity
asmeurer commentedon Mar 8, 2024
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.
Allow Python scalars in torch functions
asmeurer commentedon Mar 8, 2024
aren't portable. You shouldn't use them if you are aiming for full array API compatibility.
Fix at #101