inner_product¶
- probnum.utils.linalg.inner_product(v, w, A=None)[source]¶
Inner product \(\langle v, w \rangle_A := v^T A w\).
For n-d arrays the function computes the inner product over the last axis of the two arrays
v
andw
.- Parameters
- Returns
Inner product(s) of
v
andw
.- Return type
inprod
Notes
Note that the broadcasting behavior of
inner_product()
differs fromnumpy.inner()
. Rather it follows the broadcasting rules ofnumpy.matmul()
in that n-d arrays are treated as stacks of vectors.