jax.lax.dot#
- jax.lax.dot(lhs, rhs, precision=None, preferred_element_type=None)[source]#
Vector/vector, matrix/vector, and matrix/matrix multiplication.
Wraps XLA’s Dot operator.
For more general contraction, see the
jax.lax.dot_general()
operator.- Parameters:
lhs (Array) – an array of dimension 1 or 2.
rhs (Array) – an array of dimension 1 or 2.
precision (PrecisionLike | None) –
Optional. This parameter controls the numerics of the computation, and it can be one of the following:
None
, which means the default precision for the current backend,a
Precision
enum value or a tuple of twoPrecision
enums indicating precision oflhs`
andrhs
, ora
DotAlgorithm
or aDotAlgorithmPreset
indicating the algorithm that must be used to accumulate the dot product.
preferred_element_type (DTypeLike | None | None) – Optional. This parameter controls the data type output by the dot product. By default, the output element type of this operation will match the
lhs
andrhs
input element types under the usual type promotion rules. Settingpreferred_element_type
to a specificdtype
will mean that the operation returns that element type. Whenprecision
is not aDotAlgorithm
orDotAlgorithmPreset
,preferred_element_type
provides a hint to the compiler to accumulate the dot product using this data type.
- Returns:
An array containing the product.
- Return type: