IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Mojo function

outer_product_acc

def 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:

Was this page helpful?