RAII guard that sets gradient tracking to enabled for its lifetime on the calling thread, and restores the flag it found. A backward pass runs under one: on only when it records the graph of its own gradients.
Constructors
1ctor
GradModeGuard
void GradModeGuard(bool enabled)Destructor
1dtor
~GradModeGuard
void ~GradModeGuard()