Skip to content
class

GradModeGuard

GradModeGuard

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

1

Destructor

1

Operators

1
op

operator=

GradModeGuard & operator=(const GradModeGuard &)