nnrl/optim/kfac.py
def record_stats(self):
        """Activate registered forward and backward hooks."""
        self.zero_grad()
        fwd_handles, bwd_handles = self.register_hooks()
        try:
            yield
        finally:
            self.remove_hooks(fwd_handles, bwd_handles)
Activate registered forward and backward hooks.
Activate registered forward and backward hooks.
Activate registered forward and backward hooks .
def record_stats(self):
        self.zero_grad()
        fwd_handles, bwd_handles = self.register_hooks()
        try:
            yield
        finally:
            self.remove_hooks(fwd_handles, bwd_handles)
def record_stats ( self ) : self . zero_grad ( ) fwd_handles , bwd_handles = self . register_hooks ( ) try : yield finally : self . remove_hooks ( fwd_handles , bwd_handles )
Activate registered forward and backward hooks.
Activate registered forward and backward hooks .
"""Activate registered forward and backward hooks."""
self