@@ -4,8 +4,8 @@ The following array libraries are supported. This page outlines the known
4
4
differences between this library and the array API specification for the
5
5
supported packages.
6
6
7
- Note that the [ ` array_namespace() ` ] ( helper-functions.md ) helper will also
8
- support any array library that explicitly supports the array API by defining
7
+ Note that the {func} ` ~. array_namespace()` helper will also support any array
8
+ library that explicitly supports the array API by defining
9
9
[ ` __array_namespace__ ` ] ( https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.__array_namespace__.html ) .
10
10
11
11
Any reasonably popular array library is in-scope for array-api-compat,
@@ -17,18 +17,18 @@ complexity. If your favorite library is not supported, feel free to open an
17
17
18
18
NumPy 2.0 has full array API compatibility. This package is not strictly
19
19
necessary for NumPy 2.0 support, but may still be useful for the support of
20
- other libraries, as well as for the [ helper functions] ( helper-functions.md ) .
20
+ other libraries, as well as for the [ helper functions] ( helper-functions.rst ) .
21
21
22
22
For NumPy 1.26, as well as corresponding versions of CuPy, the following
23
23
deviations from the standard should be noted:
24
24
25
25
- The array methods ` __array_namespace__ ` , ` device ` (for NumPy), ` to_device ` ,
26
26
and ` mT ` are not defined. This reuses ` np.ndarray ` and ` cp.ndarray ` and we
27
27
don't want to monkey patch or wrap it. The [ helper
28
- functions] ( helper-functions.md ) ` device() ` and ` to_device() ` are provided to
29
- work around these missing methods. ` x.mT ` can be replaced with
30
- ` xp.linalg.matrix_transpose(x) ` . ` array_namespace(x ) ` should be used instead
31
- of ` x.__array_namespace__ ` .
28
+ functions] ( helper-functions.rst ) {func} ` ~. device()` and {func} ` ~. to_device()`
29
+ are provided to work around these missing methods. ` x.mT ` can be replaced
30
+ with ` xp.linalg.matrix_transpose(x) ` . {func} ` ~. array_namespace()` should be
31
+ used instead of ` x.__array_namespace__ ` .
32
32
33
33
- Value-based casting for scalars will be in effect unless explicitly disabled
34
34
with the environment variable ` NPY_PROMOTION_STATE=weak ` or
@@ -63,14 +63,14 @@ version.
63
63
64
64
- Like NumPy/CuPy, we do not wrap the ` torch.Tensor ` object. It is missing the
65
65
` __array_namespace__ ` and ` to_device ` methods, so the corresponding helper
66
- functions ` array_namespace() ` and ` to_device() ` in this library should be
67
- used instead (see above) .
66
+ functions {func} ` ~. array_namespace()` and {func} ` ~. to_device()` in this
67
+ library should be used instead .
68
68
69
69
- The ` x.size ` attribute on ` torch.Tensor ` is a function that behaves
70
70
differently from
71
71
[ ` x.size ` ] ( https://data-apis.org/array-api/draft/API_specification/generated/array_api.array.size.html )
72
- in the spec. Use the ` size(x ) ` helper function as a portable workaround (see
73
- above) .
72
+ in the spec. Use the {func} ` ~. size()` helper function as a portable
73
+ workaround .
74
74
75
75
- PyTorch does not have unsigned integer types other than ` uint8 ` , and no
76
76
attempt is made to implement them here.
@@ -95,8 +95,7 @@ version.
95
95
[ ` var() ` ] ( https://data-apis.org/array-api/latest/API_specification/generated/array_api.var.html#array_api.var )
96
96
do not support floating-point ` correction ` .
97
97
98
- - The ` stream ` argument of the ` to_device() ` helper (see above) is not
99
- supported.
98
+ - The ` stream ` argument of the {func}` ~.to_device() ` helper is not supported.
100
99
101
100
- As with NumPy, type annotations and positional-only arguments may not
102
101
exactly match the spec for functions that are not wrapped at all.
0 commit comments