fn
outer
→Tensorouter(x: Tensor, y: Tensor)Outer product of two 1-D tensors.
Parameters
xTensor1-D tensor of length .
yTensor1-D tensor of length .
Returns
TensorMatrix of shape (m, n).
Notes
Computes the rank-1 matrix
yielding the same result as viewed as a 2-D array.
Outer products underpin rank-1 updates (BFGS), Kronecker-product
factorisations, and certain attention patterns. Unlike
matmul, the inputs are not contracted — every pair
produces an independent entry.
Examples
>>> import lucid
>>> from lucid.linalg import outer
>>> outer(lucid.tensor([1.0, 2.0]), lucid.tensor([3.0, 4.0]))
Tensor([[3.0000, 4.0000],
[6.0000, 8.0000]])