Autograd node for scalar-base reverse power: .
The base is captured on the node; the output tensor (and the input
when base == 0) is saved because the gradient formula uses
directly and masks when .
Math
Forward
Backward
\frac{\partial L}{\partial y_i}$$ **See Also** `PowScalarBackward`, `rpow_scalar_op`.Attributes
base_doublestd::log(base_) is computed inside grad_formula.kSavesInputboolfalse by default (input saved only when base_ == 0).kSavesOutputbooltrue — the forward output is saved.schema_ v1OpSchema"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
basedoubleaconst TensorImplPtr&Returns
TensorImplPtrOutput tensor with the same shape and (post-promotion) dtype as a; the backward node carries base and the saved output.
Methods
2Computes from the saved output and the captured base_.
Parameters
gconst Storage&Returns
StorageGradient with respect to x.
Graph-mode backward: from the tracked output, so the second derivative sees 's dependence on .