Skip to content
class

MatmulOpts

MatmulOpts

Parameter bag for a single matrix-multiplication call.

Carries the logical shape and transposition flags for one a @ b product. Dimensions are interpreted in logical (not transposed) order so the result is always (M×K)⋅(K×N)=(M×N)(M \times K) \cdot (K \times N) = (M \times N) regardless of the transA / transB flags.

See Also

IBackend::matmul — consumes this struct.

Attributes

transAbool
If true the dispatched kernel treats the left operand as transposed before contraction.
transBbool
If true the dispatched kernel treats the right operand as transposed before contraction.
Mint
Number of rows of the (post-transpose) left operand.
Kint
Contracted inner dimension.
Nint
Number of columns of the (post-transpose) right operand.
batchstd::size_t
Number of independent matmuls stacked along the leading axis. batch == 1 is the standard 2-D case; batch > 1 indicates a batched matmul where the same A/B strides repeat batch times.