classAbsBackwardAbsBackwardsourceeditPython wrappersPublic Python APIs implemented by this engine symbol.pylucid.ops.absfunctionStatic methods1staticdispatchint dispatch(backend::IBackend & be, const int & a, const int & s, Dtype dt)sourceeditForward — calls IBackend::abs to compute y=∣x∣y = |x|y=∣x∣.Methods2fngrad_formulaint grad_formula(const int & g)sourceeditBackward — ∂y/∂x=sign(x)\partial y/\partial x = \mathrm{sign}(x)∂y/∂x=sign(x), scaled by grad_out.fngrad_formula_implint grad_formula_impl(const int & g, const int & x, const int &)sourceeditGraph-mode backward: the same derivative built from composable ops, so the gradient itself stays differentiable.
staticdispatchint dispatch(backend::IBackend & be, const int & a, const int & s, Dtype dt)sourceeditForward — calls IBackend::abs to compute y=∣x∣y = |x|y=∣x∣.
fngrad_formulaint grad_formula(const int & g)sourceeditBackward — ∂y/∂x=sign(x)\partial y/\partial x = \mathrm{sign}(x)∂y/∂x=sign(x), scaled by grad_out.
fngrad_formula_implint grad_formula_impl(const int & g, const int & x, const int &)sourceeditGraph-mode backward: the same derivative built from composable ops, so the gradient itself stays differentiable.