General dot product of two arrays, supporting contraction over arbitrary axes and batching.
Arguments
- lhs, rhs
(
arrayish)
Two inputs of the same data type whose shapes are constrained bycontracting_axesandbatching_axesrather than having to match. Can be any data type. R values assume the other operand's data type when it is in their data type category, and their default data type when neither operand has one.- contracting_axes
(
list(integer(), integer()))
A list of two integer vectors specifying which axes oflhsandrhsto contract over. The contracted axes must have matching sizes.- batching_axes
(
list(integer(), integer()))
A list of two integer vectors specifying which axes oflhsandrhsare batch axes. These must have matching sizes.- precision
(
character(1))
Controls the trade-off between speed and numerical accuracy of the operation. One of"highest"(default),"high"or"default". Only the StableHLO backend honors this; it is ignored by the quickr backend.
Value
(arrayish)
Has the data type the operands agreed on. The output shape is the batch
axes followed by the remaining
(non-contracted, non-batched) axes of lhs, then rhs.
StableHLO
Lowers to hlo_dot_general(), specified under
dot_general.
See also
nv_matmul(), %*%