General dot product of two tensors, supporting contraction over arbitrary dimensions and batching.
Arguments
- lhs, rhs
(
tensorish)
Left and right operand. Operands are promoted to a common data type. Scalars are broadcast to the shape of the other operand.- contracting_dims
(
list(integer(), integer()))
A list of two integer vectors specifying which dimensions oflhsandrhsto contract over. The contracted dimensions must have matching sizes.- batching_dims
(
list(integer(), integer()))
A list of two integer vectors specifying which dimensions oflhsandrhsare batch dimensions. These must have matching sizes.
Value
tensorish
The output shape is the batch dimensions followed by the remaining
(non-contracted, non-batched) dimensions of lhs, then rhs.
StableHLO
Lowers to stablehlo::hlo_dot_general().
See also
nv_matmul(), %*%