Python wrappers
Public Python APIs implemented by this engine symbol.Autograd node for element-wise round-to-nearest-even: .
Piecewise-constant; derivative is zero almost everywhere and undefined at half-integer boundaries. The node stays in the graph with that zero gradient, as the reference keeps it.
Math
Ties round to even ("banker's rounding"), matching IEEE-754.
See Also
FloorBackward, CeilBackward.
Attributes
kSavesInputboolfalse — no tensor needs to be saved across the backward pass.kHasGradientbooltrue — kept in the graph with a zero gradient.schema_ v1OpSchemaOp name
"round" with AmpPolicy::KeepInput (integer inputs pass through unchanged).Notes
CPU dispatch routes through backend::IBackend::round; GPU uses
MLX's round primitive. Integer dtypes are a no-op.
Static methods
1Methods
2Zero gradient, shaped like the output.
Parameters
gconst Storage&Incoming upstream gradient (ignored).
Returns
StorageZeros shaped like the output.
Graph-mode backward — zero, like grad_formula, so the node stays differentiable under create_graph.