Autograd node for scalar-base reverse power: .
The base is captured on the node; the output tensor (not the input) is saved because the gradient formula uses directly.
Math
Forward
Backward
\frac{\partial L}{\partial y_i}$$ **See Also** `PowScalarBackward`, `rpow_scalar_op`.Attributes
base_doubleScalar base captured at forward;
std::log(base_) is computed inside grad_formula.kSavesInputboolfalse — the input is not needed for the backward pass.kSavesOutputbooltrue — the forward output is saved.schema_v1OpSchemaOp name
"rpow_scalar" with AmpPolicy::ForceFP32.Notes
Undefined for base <= 0 (ln would not be real). Use
pow_scalar_op if the exponent — not the base — is the scalar.
Static methods
1Forward dispatch with base capture — computes , saves the output on the backward node, and wires autograd manually (save_input=false).
Parameters
basedoubleScalar base (must be positive for a real-valued gradient).
aconst TensorImplPtr&Input tensor — the exponent.
Returns
TensorImplPtrOutput tensor with the same shape and (post-promotion) dtype as a; the backward node carries base and the saved output.