@@ -4,8 +4,8 @@ The following array libraries are supported. This page outlines the known
44differences between this library and the array API specification for the
55supported packages.
66
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
99[ ` __array_namespace__ ` ] ( https://data-apis.org/array-api/latest/API_specification/generated/array_api.array.__array_namespace__.html ) .
1010
1111Any 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
1717
1818NumPy 2.0 has full array API compatibility. This package is not strictly
1919necessary 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 ) .
2121
2222For NumPy 1.26, as well as corresponding versions of CuPy, the following
2323deviations from the standard should be noted:
2424
2525- The array methods ` __array_namespace__ ` , ` device ` (for NumPy), ` to_device ` ,
2626 and ` mT ` are not defined. This reuses ` np.ndarray ` and ` cp.ndarray ` and we
2727 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__ ` .
3232
3333- Value-based casting for scalars will be in effect unless explicitly disabled
3434 with the environment variable ` NPY_PROMOTION_STATE=weak ` or
@@ -63,14 +63,14 @@ version.
6363
6464- Like NumPy/CuPy, we do not wrap the ` torch.Tensor ` object. It is missing the
6565 ` __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 .
6868
6969- The ` x.size ` attribute on ` torch.Tensor ` is a function that behaves
7070 differently from
7171 [ ` 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 .
7474
7575- PyTorch does not have unsigned integer types other than ` uint8 ` , and no
7676 attempt is made to implement them here.
@@ -95,8 +95,7 @@ version.
9595 [ ` var() ` ] ( https://data-apis.org/array-api/latest/API_specification/generated/array_api.var.html#array_api.var )
9696 do not support floating-point ` correction ` .
9797
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.
10099
101100- As with NumPy, type annotations and positional-only arguments may not
102101 exactly match the spec for functions that are not wrapped at all.
0 commit comments