dot

arrayfire.dot(lhs: Array, rhs: Array, /, *, return_scalar: Literal[True]) int | float | complex
arrayfire.dot(lhs: Array, rhs: Array, /, *, return_scalar: Literal[False] = False) Array

Calculates the dot product of two input arrays, with options to modify the operation on the input arrays and the possibility to return the result as a scalar.

Parameters

lhsArray

A 1-dimensional, int of float Array instance, representing an array.

rhsArray

A 1-dimensional, int of float Array instance, representing another array.

return_scalarbool, optional

When set to True, the input arrays are flattened, and the output is a scalar value. Default is False.

Returns

outint | float | complex | Array

The result of the dot product. Returns an Array unless return_scalar is True, in which case a scalar value (int, float, or complex) is returned based on the data type of the inputs.

Note

  • The data types of lhs and rhs should be the same.

  • Batch operations are not supported.

  • Modification options for lhs and rhs are currently disabled as function supports only MatProp.NONE.