IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

apple_batched_matmul

def apple_batched_matmul[rank: Int, *, transpose_b: Bool = False, elementwise_epilogue_fn: Optional[def[c_type: DType, width: SIMDLength, rank: Int, *, alignment: Int = Int(1)](IndexList[rank], SIMD[c_type, width]) capturing thin -> None] = None](c: TileTensor[Storage=c.Storage, address_space=c.address_space, linear_idx_type=c.linear_idx_type], a: TileTensor[Storage=a.Storage, address_space=a.address_space, linear_idx_type=a.linear_idx_type], b: TileTensor[Storage=b.Storage, address_space=b.address_space, linear_idx_type=b.linear_idx_type], c_shape_idx: IndexList[rank])

Performs a batched single-precision matmul via the Apple Accelerate library.

Iterates over all batch dimensions (all axes except the last two), calling apple_matmul for each 2D slice. Requires at least rank-3 tensors and all operands to be DType.float32.

Parameters:

Args:

Was this page helpful?