Skip to main content

outer

Function outer 

pub fn outer<const D: usize, const R: usize, K>(
    lhs: Tensor<D, K>,
    rhs: Tensor<D, K>,
) -> Tensor<R, K>
where K: Numeric,
Expand description

Computes the outer product for the last columns of 2 tensors.

See also: outer_dim.

§Arguments

  • lhs: the “row” tensor, with shape [..., i].
  • rhs: the “col” tensor, with shape [..., j].

§Returns

A tensor of rank R = D + 1, where:

result[..., i, j] = lhs[..., i] * rhs[..., j]