Skip to content
fn

accumulate_leaf

void accumulate_leaf(TensorImpl & leaf, int grad)

Accumulate grad into leaf's .grad: nothing unless the leaf requires grad, then the cast to its dtype, its hooks, and the sum.

Parameters

The leaf the gradient is for.
gradStorage
The gradient, in any floating dtype.