# chainer.functions.batch_matmul¶

chainer.functions.batch_matmul(a, b, transa=False, transb=False)[source]

Computes the batch matrix multiplications of two sets of arrays.

Parameters
• a (Variable or N-dimensional array) – The left operand of the batch matrix multiplications. A 2-D array of shape (B, N) is considered as B $$N \times 1$$ matrices. A 3-D array of shape (B, M, N) is considered as B $$M \times N$$ matrices.

• b (Variable or N-dimensional array) – The right operand of the batch matrix multiplications. Its array is treated as matrices in the same way as a’s array.

• transa (bool) – If True, transpose each matrix in a.

• transb (bool) – If True, transpose each matrix in b.

Returns

The result of the batch matrix multiplications as a 3-D array.

Return type

Variable

Deprecated since version v3.0.0: batch_matmul is deprecated. Use matmul instead.