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

apply_elementwise_epilogue

def apply_elementwise_epilogue[EpilogueFnType: ElementwiseEpilogueFn, dtype: DType, width: SIMDLength, //, elementwise_lambda_fn: Optional[def[dtype: DType, width: SIMDLength, *, alignment: Int = Int(1)](IndexList[Int(2)], SIMD[dtype, width]) capturing thin -> None], *, alignment: Int = Int(1)](epilogue_fn: EpilogueFnType, idx: IndexList[Int(2)], val: SIMD[dtype, width])

Applies the legacy epilogue lambda if set, otherwise epilogue_fn.

Kernels that accept both epilogue forms call this under comptime if elementwise_lambda_fn or has_epilogue_fn.

Parameters:

Args:

  • ​epilogue_fn (EpilogueFnType): Value epilogue, used when elementwise_lambda_fn is unset.
  • ​idx (IndexList[Int(2)]): Output coordinates.
  • ​val (SIMD[dtype, width]): Output value.

Was this page helpful?