Skip to main content

Module unary

Module unary 

Source
Expand description

High-performance CPU Unary operation kernels.

ReLU is bandwidth-bound (simple comparison) → single-threaded, LLVM auto-vectorizes. Sigmoid is compute-bound (exp() is expensive) → uses Rayon for large tensors.

Functions§

relu_forward
Executes the Rectified Linear Unit (ReLU) activation function: f(x) = max(0, x)
sigmoid_forward
Executes the Sigmoid activation function: f(x) = 1 / (1 + exp(-x))