For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
apply_q
def apply_q[dtype: DType, element_layout: Layout](sigma: LayoutTensor[dtype, address_space=sigma.address_space, element_layout=element_layout, layout_int_type=sigma.layout_int_type, linear_idx_type=sigma.linear_idx_type, masked=sigma.masked, alignment=sigma.alignment], A: LayoutTensor[dtype, address_space=A.address_space, element_layout=element_layout, layout_int_type=A.layout_int_type, linear_idx_type=A.linear_idx_type, masked=A.masked, alignment=A.alignment], X: LayoutTensor[dtype, address_space=X.address_space, element_layout=element_layout, layout_int_type=X.layout_int_type, linear_idx_type=X.linear_idx_type, masked=X.masked, alignment=X.alignment])
Applies the implicit Q factor stored in A and sigma after calling qr_factorization to the X matrix.
See qr_factorization for more details on the construction of the
Householder reflector.
Parameters:
- dtype (
DType): Element type of the matrices. - element_layout (
Layout): Memory layout of theLayoutTensorinputs.
Args:
- sigma (
LayoutTensor[dtype, address_space=sigma.address_space, element_layout=element_layout, layout_int_type=sigma.layout_int_type, linear_idx_type=sigma.linear_idx_type, masked=sigma.masked, alignment=sigma.alignment]): Vector of lengthnholding the Householder scaling factors produced byqr_factorization. - A (
LayoutTensor[dtype, address_space=A.address_space, element_layout=element_layout, layout_int_type=A.layout_int_type, linear_idx_type=A.linear_idx_type, masked=A.masked, alignment=A.alignment]):m×nmatrix containing the implicitQfactor as produced byqr_factorization. - X (
LayoutTensor[dtype, address_space=X.address_space, element_layout=element_layout, layout_int_type=X.layout_int_type, linear_idx_type=X.linear_idx_type, masked=X.masked, alignment=X.alignment]):m×q_nmatrix to multiply byQ. Must have the same number of rows asA. Overwritten withQ·Xin-place.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!