dpctl.tensor.vecdot(x1, x2, axis=-1)[source]

Computes the (vector) dot product of two arrays.

  • x1 (usm_ndarray) – first input array.

  • x2 (usm_ndarray) – second input array. Input arrays must have compatible shapes along non-contract axes according to broadcasting rules, and must have the same size along the contracted axis. Input arrays should be of numeric type.

  • axis (Optional[int]) – axis over which to compute the dot product. The axis must be an integer on the interval [-N, -1], where N is min(x1.ndim, x2.ndim). The axis along which dot product is performed is counted backward from the last axes (that is, -1 refers to the last axis). By default, dot product is computed over the last axis. Default: -1.


if x1 and x2 are both one-dimensional arrays, a zero-dimensional array containing the dot product value is returned; otherwise, a non-zero-dimensional array containing the dot products and having rank N-1, where N is the rank of the shape of input arrays after broadcasting rules are applied to non-contracted axes.

Return type: