Python wrappers
Public Python APIs implemented by this engine symbol.Compute the outer (tensor) product of two 1-D vectors, yielding a 2-D matrix.
The implementation evaluates the outer product as a degenerate GEMM
between reshaped operands: a[:, None] @ b[None, :] — i.e. an
matmul producing an result. On
Accelerate this maps onto cblas_sger (rank-1 update) or
cblas_*gemm; on the GPU stream it routes through MLX's matmul
primitive. Autograd is wired through the package-private
OuterBackward node, which saves both operands.
Math
Forward:
Backward (with ):
Shape
a.shape == {M}andb.shape == {N}.- Output shape
{M, N}.
References
NumPy numpy.outer (which Lucid mirrors for the 1-D case).
See Also
dot_op : 1-D × 1-D inner product (the "dual" of outer). inner_op : Last-axis contraction. matmul_op : Generalised matmul with batch broadcasting.
Parameters
aTensorImplPtrbTensorImplPtrReturns
TensorImplPtrOutput matrix of shape with .
Raises
ShapeMismatchNotes
Schema uses AmpPolicy::KeepInput — outer products on integer
vectors are valid and must not be promoted.
Examples
// a: [3], b: [4] → out: [3, 4]
// out[i, j] = a[i] * b[j]