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.result_type results are order-dependent when default dtype is float64 #273
In [1]: import torch
In [2]: torch.set_default_dtype(torch.float64)
In [3]: dt_a, dt_b = torch.float32, torch.int32
In [4]: a, b = torch.empty(1, dtype=dt_a), torch.empty(1, dtype=dt_b)
In [5]: torch.result_type(a, 1.0)
Out[5]: torch.float32
In [6]: torch.result_type(b, 1.0)
Out[6]: torch.float64
This is, strictly speaking, unspecified by the Array API spec because it combines a python float and an integer array.
This is still something we should fix in array-api-compat, and relatively quickly.
I think we'll release array-api-compat==1.11.2 once data-apis/array-api-tests#349 and #277 land.
Activity
ev-br commentedon Mar 17, 2025
The root cause seems to be this:
This is, strictly speaking, unspecified by the Array API spec because it combines a python float and an integer array.
This is still something we should fix in
array-api-compat, and relatively quickly.I think we'll release
array-api-compat==1.11.2once data-apis/array-api-tests#349 and #277 land.