Returns the inner product of a and b for arrays of floating point types. Like the generic NumPy equivalent the product sum is over the last dimension of a and b. The first argument is not conjugated.
(a, b)
| 7923 | |
| 7924 | |
| 7925 | def inner(a, b): |
| 7926 | """ |
| 7927 | Returns the inner product of a and b for arrays of floating point types. |
| 7928 | |
| 7929 | Like the generic NumPy equivalent the product sum is over the last dimension |
| 7930 | of a and b. The first argument is not conjugated. |
| 7931 | |
| 7932 | """ |
| 7933 | fa = filled(a, 0) |
| 7934 | fb = filled(b, 0) |
| 7935 | if fa.ndim == 0: |
| 7936 | fa.shape = (1,) |
| 7937 | if fb.ndim == 0: |
| 7938 | fb.shape = (1,) |
| 7939 | return np.inner(fa, fb).view(MaskedArray) |
| 7940 | inner.__doc__ = doc_note(np.inner.__doc__, |
| 7941 | "Masked values are replaced by 0.") |
| 7942 | innerproduct = inner |