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_epilogue
def apply_epilogue[elementwise_lambda: def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None, dst_layout: Layout, dst_element_layout: Layout = Layout(IntTuple(Int(1)), IntTuple(Int(1)))](src: LayoutTensor[address_space=src.address_space, element_layout=src.element_layout, layout_int_type=src.layout_int_type, linear_idx_type=src.linear_idx_type, masked=src.masked, alignment=src.alignment], offset: Int)
Applies an elementwise epilogue lambda to a source tile.
Walks the elements of src and invokes elementwise_lambda with each
element's (m, n) coordinate and value, handling both 2D SIMD tiles and
the scalar/1D case.
Parameters:
- βelementwise_lambda (
def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None): The epilogue lambda to apply per element. - βdst_layout (
Layout): The layout of the destination tensor. - βdst_element_layout (
Layout): The element layout of the destination tensor.
Args:
- βsrc (
LayoutTensor[address_space=src.address_space, element_layout=src.element_layout, layout_int_type=src.layout_int_type, linear_idx_type=src.linear_idx_type, masked=src.masked, alignment=src.alignment]): The source tile to read elements from. - βoffset (
Int): The linear offset into the destination tensor.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!