summaryrefslogtreecommitdiff
path: root/numpy/_array_api/__init__.py
diff options
context:
space:
mode:
authorAaron Meurer <asmeurer@gmail.com>2021-07-01 15:48:19 -0600
committerAaron Meurer <asmeurer@gmail.com>2021-07-01 15:48:19 -0600
commitcad21e94b58b125a4264f154e91a1730dcf550da (patch)
treeae6e402e0e8d60a03a493b4d7d11d2417041c13a /numpy/_array_api/__init__.py
parentf6015d2754dde04342ca2a0d719ca7f01d6e0dcb (diff)
downloadnumpy-cad21e94b58b125a4264f154e91a1730dcf550da.tar.gz
Update the linear algebra functions in the array API namespace
For now, only the functions in from the main spec namespace are implemented. The remaining linear algebra functions are part of an extension in the spec, and will be implemented in a future pull request. This is because the linear algebra functions are relatively complicated, so they will be easier to review separately. This also updates those functions that do remain for now to be more compliant with the spec.
Diffstat (limited to 'numpy/_array_api/__init__.py')
-rw-r--r--numpy/_array_api/__init__.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/numpy/_array_api/__init__.py b/numpy/_array_api/__init__.py
index 56699b09d..e39a2c7d0 100644
--- a/numpy/_array_api/__init__.py
+++ b/numpy/_array_api/__init__.py
@@ -47,8 +47,8 @@ A few notes about the current state of this submodule:
- np.argmin and np.argmax do not implement the keepdims keyword argument.
- - Some linear algebra functions in the spec are still a work in progress (to
- be added soon). These will be updated once the spec is.
+ - The linear algebra extension in the spec will be added in a future pull
+request.
- Some tests in the test suite are still not fully correct in that they test
all datatypes whereas certain functions are only defined for a subset of
@@ -132,13 +132,14 @@ from ._elementwise_functions import abs, acos, acosh, add, asin, asinh, atan, at
__all__ += ['abs', 'acos', 'acosh', 'add', 'asin', 'asinh', 'atan', 'atan2', 'atanh', 'bitwise_and', 'bitwise_left_shift', 'bitwise_invert', 'bitwise_or', 'bitwise_right_shift', 'bitwise_xor', 'ceil', 'cos', 'cosh', 'divide', 'equal', 'exp', 'expm1', 'floor', 'floor_divide', 'greater', 'greater_equal', 'isfinite', 'isinf', 'isnan', 'less', 'less_equal', 'log', 'log1p', 'log2', 'log10', 'logaddexp', 'logical_and', 'logical_not', 'logical_or', 'logical_xor', 'multiply', 'negative', 'not_equal', 'positive', 'pow', 'remainder', 'round', 'sign', 'sin', 'sinh', 'square', 'sqrt', 'subtract', 'tan', 'tanh', 'trunc']
-from ._linear_algebra_functions import cross, det, diagonal, inv, norm, outer, trace, transpose
+# einsum is not yet implemented in the array API spec.
-__all__ += ['cross', 'det', 'diagonal', 'inv', 'norm', 'outer', 'trace', 'transpose']
+# from ._linear_algebra_functions import einsum
+# __all__ += ['einsum']
-# from ._linear_algebra_functions import cholesky, cross, det, diagonal, dot, eig, eigvalsh, einsum, inv, lstsq, matmul, matrix_power, matrix_rank, norm, outer, pinv, qr, slogdet, solve, svd, trace, transpose
-#
-# __all__ += ['cholesky', 'cross', 'det', 'diagonal', 'dot', 'eig', 'eigvalsh', 'einsum', 'inv', 'lstsq', 'matmul', 'matrix_power', 'matrix_rank', 'norm', 'outer', 'pinv', 'qr', 'slogdet', 'solve', 'svd', 'trace', 'transpose']
+from ._linear_algebra_functions import matmul, tensordot, transpose, vecdot
+
+__all__ += ['matmul', 'tensordot', 'transpose', 'vecdot']
from ._manipulation_functions import concat, expand_dims, flip, reshape, roll, squeeze, stack