Python wrappers
Public Python APIs implemented by this engine symbol.Autograd node for the element-wise sign function .
Because sign is piecewise constant its derivative vanishes almost
everywhere; the node therefore carries no gradient information.
kHasGradient = false tells UnaryKernel::forward to skip the
autograd wiring entirely, and grad_formula returns an empty
CpuStorage only as a defensive zero-sentinel if it is ever invoked
manually.
Math
\frac{\partial y}{\partial x} = 0 \text{ almost everywhere}.$$Attributes
schema_v1OpSchemaRegistered as
"sign" with AmpPolicy::KeepInput — integer dtypes pass through unmodified.kSavesInputboolfalse.kHasGradientboolfalse — no autograd edge is created.Notes
Dispatch: Accelerate sign kernel (CPU) / MLX sign (GPU).