Function outer_dim
pub fn outer_dim<B, const D: usize, const R: usize, Dim, K>(
lhs: Tensor<B, D, K>,
rhs: Tensor<B, D, K>,
dim: Dim,
) -> Tensor<B, R, K>Expand description
Computes the outer product along a specific dimension, broadcasting over others.
For the given dim, computes the outer product of elements along that dimension,
expanding it into two dimensions of size M × N at positions (dim, dim + 1).
§Arguments
lhs: left operand, the “row” tensor, with sizeMat dimensiondim.rhs: right operand, the “col” tensor, with sizeNat dimensiondim.dim: dimension to compute the outer product along (supports negative indexing).
§Returns
A tensor of rank R = D + 1, where:
result[..., i, j, ...] = lhs[..., i, ...] * rhs[..., j, ...]