-
Notifications
You must be signed in to change notification settings - Fork 34
Minimum supported PyTorch version? #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
>>> import torch
>>> torch.__version__
'1.13.0'
>>> torch.std(torch.arange(3, dtype=torch.float32), (0,), correction=2)
tensor(1.4142) I've tested all the pytorch support against 1.13 so things should work there. I haven't tested against 2.0 yet, but don't expect too many breakages. We should probably support at least 1.13 and 2.0 for now. Let me know if supporting anything earlier is important for you. |
|
From the weekly call, |
As a minimum reproducer, the following fails on 1.13: import torch
import array_api_compat
x = torch.asarray([1.0, 2.0, 3.0])
xp = array_api_compat.get_namespace(x)
xp.std(x)
# TypeError: std() received an invalid combination of arguments - got (Tensor, tuple, correction=float), but expected one of:
# * (Tensor input, tuple of ints dim, *, int correction, bool keepdim, Tensor out)
# * (Tensor input, tuple of ints dim, bool unbiased, bool keepdim, *, Tensor out)
# * (Tensor input, bool unbiased)
# * (Tensor input, tuple of names dim, *, int correction, bool keepdim, Tensor out)
# * (Tensor input, tuple of names dim, bool unbiased, bool keepdim, *, Tensor out) Setting |
The test suite xfail of this not working with nonintegral correction made me not realize this was broken with the default value. This is fixed in #25 |
Similar to #21 but for other array libraries. For example, PyTorch
correction
was is in 2.0, but not in previous versions. The following fails for PyTorch < 2.0:array-api-compat/array_api_compat/torch/_aliases.py
Line 378 in e2203df
For reference, here are the
torch.std
docs for 1.13 and 2.0.The text was updated successfully, but these errors were encountered: