ENH: `torch` dtype promotions
- On PyTorch >=2.3, support uint16, uint32, and uint64 in
result_type - On PyTorch >=2.3,
sumandprodwill now promote uint8, uint16 and uint32 to uint64.
https://github.com/data-apis/array-api-compat/pull/253 seems to have run into a wall with uint promotions in pytorch, did something change meanwhile in the meantime?
#253 seems to have run into a wall with uint promotions in pytorch, did something change meanwhile in the meantime?
No, nothing has changed on the torch side AFAIK.
- The changes to the dtypes table in this PR are functionally the same as in #253, but IMHO cleaner. They don't need to wait for full torch support in various functions to be merged.
- The fix to
sum(x, dtype=x.dtype, axis=()is unrelated to dtype promotion - The promotion of uint8/16/32 to uint64 in
sumandprodis missing in #253, and something you want to have anyway - Unlike #253, this PR changes neither CI nor
__array_namespace_info__, which is what makes that PR non-mergeable.
this PR changes neither CI nor array_namespace_info, which is what makes that PR non-mergeable.
You lost me here :-). So is it basically "let's add something because we want it, but not test it on CI because we know it'll break"?
this PR changes neither CI nor array_namespace_info, which is what makes that PR non-mergeable.
You lost me here :-). So is it basically "let's add something because we want it, but not test it on CI because we know it'll break"?
Well, we will need this and the other PR eventually when torch introduces support. We can either keep this PR unmerged, or leave it in main but untested by CI. Final users that somehow manage to avoid the many non-functioning APIs will benefit from it immediately.
We can either keep this PR unmerged, or leave it in main but untested by CI.
The latter we definitely do not want to do.
I've updated this to incorporate the latest changes and added the contents of #253, which can now be closed.