Python wrappers
Public Python APIs implemented by this engine symbol.Autograd node for the element-wise square .
Saves the input x so the backward pass can scale the upstream
gradient by .
Math
\frac{\partial y}{\partial x} = 2x, \qquad \frac{\partial \mathcal{L}}{\partial x} = 2x\,\frac{\partial \mathcal{L}}{\partial y}.$$Attributes
schema_v1OpSchemaRegistered as
"square" with AmpPolicy::Promote.Notes
Dispatch: Accelerate vDSP_vsq (CPU) / MLX square (GPU).