MCPcopy Create free account
hub / github.com/numpy/numpy / matmul

Function matmul

numpy/array_api/linalg.py:150–161  ·  view source on GitHub ↗

Array API compatible wrapper for :py:func:`np.matmul `. See its docstring for more information.

(x1: Array, x2: Array, /)

Source from the content-addressed store, hash-verified

148
149# Note: matmul is the numpy top-level namespace but not in np.linalg
150def matmul(x1: Array, x2: Array, /) -> Array:
151 """
152 Array API compatible wrapper for :py:func:`np.matmul <numpy.matmul>`.
153
154 See its docstring for more information.
155 """
156 # Note: the restriction to numeric dtypes only is different from
157 # np.matmul.
158 if x1.dtype not in _numeric_dtypes or x2.dtype not in _numeric_dtypes:
159 raise TypeError('Only numeric dtypes are allowed in matmul')
160
161 return Array._new(np.matmul(x1._array, x2._array))
162
163
164# Note: the name here is different from norm(). The array API norm is split

Callers 2

check_qr_stackedMethod · 0.90
pinvFunction · 0.85

Calls 1

_newMethod · 0.80

Tested by 1

check_qr_stackedMethod · 0.72