nums.numpy.inner
-
nums.numpy.
inner
(a, b)[source] Inner product of two arrays.
This docstring was copied from numpy.inner.
Some inconsistencies with the NumS version may exist.
Ordinary inner product of vectors for 1-D arrays (without complex conjugation), in higher dimensions a sum product over the last axes.
- Parameters
a (BlockArray) – If a and b are nonscalar, their last dimensions must match.
b (BlockArray) – If a and b are nonscalar, their last dimensions must match.
- Returns
out – out.shape = a.shape[:-1] + b.shape[:-1]
- Return type
- Raises
ValueError – If the last dimension of a and b has different size.
See also
Notes
Only single-axis inputs supported.
Examples
The doctests shown below are copied from NumPy. They won’t show the correct result until you operate
get()
.Ordinary inner product for vectors:
>>> a = nps.array([1,2,3]) >>> b = nps.array([0,1,0]) >>> nps.inner(a, b).get() array(2)