Mojo function
outer_product_acc
outer_product_acc(res: LayoutTensor[res.dtype, res.layout, res.origin, 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[lhs.dtype, lhs.layout, lhs.origin, 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[rhs.dtype, rhs.layout, rhs.origin, 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): The result matrix to accumulate into, shape (M, N). - โlhs (
LayoutTensor): The left-hand side vector, shape (M,). - โrhs (
LayoutTensor): The right-hand side vector, shape (N,).
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!