Skip to content
fn

bmm_op

→TensorImplPtr
int bmm_op(const int & a, const int & b)

Python wrappers

Public Python APIs implemented by this engine symbol.

Strict 3-D batched matrix multiply: Cb=Ab⋅BbC_b = A_b \cdot B_b.

Composite — rank-checked alias of matmul_op. Rejects inputs of rank ≠3\ne 3 and demands matching leading batch dimensions so the error path is crisp. Gradient flows through MatmulBackward.

Math

For every batch index b∈[0,B)b \in [0, B):

Cb,i,j=∑kAb,i,k Bb,k,j C_{b, i, j} = \sum_{k} A_{b, i, k} \, B_{b, k, j}

See Also

mm_op, matmul_op.

Parameters

aTensorImplPtr
Left operand of shape (B, M, K).
bTensorImplPtr
Right operand of shape (B, K, N). Leading batch B must match a.

Returns

TensorImplPtr

Tensor of shape (B, M, N).

Raises

Failure
If either input is null, not exactly 3-D, or batch dimensions disagree.