AI engineering glossary · Linear algebra

What is batch matrix multiplication?

Batch matrix multiplication (also called Batched matmul): Multiplying many pairs of matrices at once, where a leading batch axis picks out each pair. Deep learning frameworks use it to run the same layer on a whole batch of inputs, or on many attention heads, in one efficient GPU call.

Level: advancedTopic: Linear algebra

Batch matrix multiplication: an example

Multiplying tensors of shape (8, 64, 32) and (8, 32, 16) gives (8, 64, 16): eight independent matrix products.

Related terms

More Linear algebra terms

Where you learn it

Batch matrix multiplication is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.

Before you go

Take the cheat sheet with you

One free PDF: the key AI-engineering terms, formulas and Python idioms. No spam; unsubscribe any time.