Skip to main content

Module elementwise

Module elementwise 

Source
Expand description

Element-wise CPU kernels — arithmetic, activations, and mathematical ops.

All kernels operate on F32 tensors. Binary ops support same-shape operands only (broadcasting handled by the dispatch layer after shape inference).

Functions§

abs
add
ceil
clip
div
erf
exp
floor
gelu
GELU approximation: 0.5 * x * (1 + tanh(sqrt(2/π) * (x + 0.044715 * x³)))
hard_swish
Hard Swish: x * relu6(x + 3) / 6
leaky_relu
log
mul
neg
pow
relu
round
sigmoid
silu
SiLU / Swish: x * sigmoid(x)
sqrt
sub
tanh_act