cunumeric.inner#

cunumeric.inner(a: ndarray, b: ndarray, out: ndarray | None = None) ndarray#

Inner product of two arrays.

Ordinary inner product of vectors for 1-D arrays (without complex conjugation), in higher dimensions a sum product over the last axes.

Parameters:
  • a (array_like) –

  • b (array_like) –

  • out (ndarray, optional) – Output argument. This must have the exact shape that would be returned if it was not present. If its dtype is not what would be expected from this operation, then the result will be (unsafely) cast to out.

Returns:

output – If a and b are both scalars or both 1-D arrays then a scalar is returned; otherwise an array is returned. output.shape = (*a.shape[:-1], *b.shape[:-1]) If out is given, then it is returned.

Return type:

ndarray

Notes

The cuNumeric implementation is a little more liberal than NumPy in terms of allowed broadcasting, e.g. inner(ones((1,)), ones((4,))) is allowed.

See also

numpy.inner

Availability:

Multiple GPUs, Multiple CPUs