Mojo function
outer_product_acc
outer_product_acc(res: LayoutTensor[dtype, layout, origin, address_space=address_space, element_layout=element_layout, layout_int_type=layout_int_type, linear_idx_type=linear_idx_type, masked=masked, alignment=alignment], lhs: LayoutTensor[dtype, layout, origin, address_space=address_space, element_layout=element_layout, layout_int_type=layout_int_type, linear_idx_type=linear_idx_type, masked=masked, alignment=alignment], rhs: LayoutTensor[dtype, layout, origin, address_space=address_space, element_layout=element_layout, layout_int_type=layout_int_type, linear_idx_type=linear_idx_type, masked=masked, alignment=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!
