warp.utils.array_inner#

warp.utils.array_inner(a, b, out=None, count=None, axis=None)[source]#

Compute the inner product of two arrays.

This function computes the dot product between two arrays, optionally along a specified axis. The operation can be performed on the entire arrays or along a specific dimension.

Parameters:
  • a (array) – First input array.

  • b (array) – Second input array. Must match shape and type of a.

  • out (array | None) – Output array to store results. If None, a new array is created.

  • count (int | None) – Number of elements to process. If None, processes entire arrays.

  • axis (int | None) – Axis along which to compute inner product. If None, computes on flattened arrays.

Returns:

The inner product result. Returns a float if axis is None and out is None, otherwise returns the out array.

Raises:

RuntimeError – If array storage devices, sizes, or data types are incompatible.

Return type:

array | float