For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
outer_product_acc
outer_product_acc(res: LayoutTensor[address_space=res.address_space, element_layout=res.element_layout, layout_int_type=res.layout_int_type, linear_idx_type=res.linear_idx_type, masked=res.masked, alignment=res.alignment], lhs: LayoutTensor[address_space=lhs.address_space, element_layout=lhs.element_layout, layout_int_type=lhs.layout_int_type, linear_idx_type=lhs.linear_idx_type, masked=lhs.masked, alignment=lhs.alignment], rhs: LayoutTensor[address_space=rhs.address_space, element_layout=rhs.element_layout, layout_int_type=rhs.layout_int_type, linear_idx_type=rhs.linear_idx_type, masked=rhs.masked, alignment=rhs.alignment])
Updates result tensor with the outer product of two vectors.
Computes res += outer(lhs, rhs) where lhs and rhs are vectors and
res is a matrix.
Constraints:
All tensors must have statically known shapes.
res must be rank 2.
lhs and rhs must be rank 1.
res.shape[0] == lhs.shape[0] and res.shape[1] == rhs.shape[0].
Args:
- res (
LayoutTensor[address_space=res.address_space, element_layout=res.element_layout, layout_int_type=res.layout_int_type, linear_idx_type=res.linear_idx_type, masked=res.masked, alignment=res.alignment]): The result matrix to accumulate into, shape (M, N). - lhs (
LayoutTensor[address_space=lhs.address_space, element_layout=lhs.element_layout, layout_int_type=lhs.layout_int_type, linear_idx_type=lhs.linear_idx_type, masked=lhs.masked, alignment=lhs.alignment]): The left-hand side vector, shape (M,). - rhs (
LayoutTensor[address_space=rhs.address_space, element_layout=rhs.element_layout, layout_int_type=rhs.layout_int_type, linear_idx_type=rhs.linear_idx_type, masked=rhs.masked, alignment=rhs.alignment]): The right-hand side vector, shape (N,).