Skip to main content

function

elementwise

elementwise()

Declares an elementwise operator.

This decorator marks an op as being elementwise. This implies that the op represents a lambda that should be executed in the inner loop of an elementwise function.

For example:

from max import register

@register.op("mo.add")
@register.elementwise()
fn my_add[...](x: SIMD[...], y: SIMD[...]) -> SIMD[...]: