Python wrappers
Public Python APIs implemented by this engine symbol.Autograd node for the element-wise base-2 logarithm .
Saves the input x; the backward divides by . The constant
is materialised in grad_formula as a high-precision literal
so accuracy is identical to scaling by 1 / log(2.0).
Math
\frac{\partial y}{\partial x} = \frac{1}{x \ln 2}, \qquad \frac{\partial \mathcal{L}}{\partial x} = \frac{1}{x \ln 2}\,\frac{\partial \mathcal{L}}{\partial y}, \quad x > 0.$$Attributes
schema_v1OpSchemaRegistered as
"log2" with AmpPolicy::ForceFP32.Notes
Dispatch: Accelerate vvlog2f/vvlog2 (CPU) / MLX log2 (GPU).