from array_api_compat import numpy, torch
import array_api_strict as strict
for xp in [numpy, torch, dask, jax, tensorflow]:
dtypes = ["int8", "int16", "int32", "int64",
"uint8", "uint16", "uint32", "uint64"]
for dtype_a in dtypes:
for dtype_b in dtypes:
try:
res = xp.result_type(getattr(xp, dtype_a), getattr(xp, dtype_b))
except:
try:
res = strict.result_type(getattr(strict, dtype_a), getattr(strict, dtype_b))
print(f"`result_type({dtype_a}, {dtype_b})` is defined by the standard, but torch does not support it.")
except:
pass
# print(f"`result_type({dtype_a}, {dtype_b})` not defined by the standard.")
`result_type(int8, uint16)` is defined by the standard, but torch does not support it.
`result_type(int8, uint32)` is defined by the standard, but torch does not support it.
`result_type(int16, uint16)` is defined by the standard, but torch does not support it.
`result_type(int16, uint32)` is defined by the standard, but torch does not support it.
`result_type(int32, uint16)` is defined by the standard, but torch does not support it.
`result_type(int32, uint32)` is defined by the standard, but torch does not support it.
`result_type(int64, uint16)` is defined by the standard, but torch does not support it.
`result_type(int64, uint32)` is defined by the standard, but torch does not support it.
`result_type(uint8, uint16)` is defined by the standard, but torch does not support it.
`result_type(uint8, uint32)` is defined by the standard, but torch does not support it.
`result_type(uint8, uint64)` is defined by the standard, but torch does not support it.
`result_type(uint16, int8)` is defined by the standard, but torch does not support it.
`result_type(uint16, int16)` is defined by the standard, but torch does not support it.
`result_type(uint16, int32)` is defined by the standard, but torch does not support it.
`result_type(uint16, int64)` is defined by the standard, but torch does not support it.
`result_type(uint16, uint8)` is defined by the standard, but torch does not support it.
`result_type(uint16, uint32)` is defined by the standard, but torch does not support it.
`result_type(uint16, uint64)` is defined by the standard, but torch does not support it.
`result_type(uint32, int8)` is defined by the standard, but torch does not support it.
`result_type(uint32, int16)` is defined by the standard, but torch does not support it.
`result_type(uint32, int32)` is defined by the standard, but torch does not support it.
`result_type(uint32, int64)` is defined by the standard, but torch does not support it.
`result_type(uint32, uint8)` is defined by the standard, but torch does not support it.
`result_type(uint32, uint16)` is defined by the standard, but torch does not support it.
`result_type(uint32, uint64)` is defined by the standard, but torch does not support it.
`result_type(uint64, uint8)` is defined by the standard, but torch does not support it.
`result_type(uint64, uint16)` is defined by the standard, but torch does not support it.
`result_type(uint64, uint32)` is defined by the standard, but torch does not support it.
The
result_typeof manyint/uintanduint/uintcombinations are defined by the standard, buttorch.result_typedoes not support them. For instance:Details