MCPcopy Create free account
hub / github.com/AtlasAnalyticsLab/AdaFisher / _save_input

Method _save_input

optimizers/kfac.py:53–59  ·  view source on GitHub ↗
(self, module, input)

Source from the content-addressed store, hash-verified

51 self.TInv = TInv
52
53 def _save_input(self, module, input):
54 if torch.is_grad_enabled() and self.steps % self.TCov == 0:
55 aa = self.CovAHandler(input[0].data, module)
56 # Initialize buffers
57 if self.steps == 0:
58 self.m_aa[module] = torch.diag(aa.new(aa.size(0)).fill_(1))
59 update_running_stat(aa, self.m_aa[module], self.stat_decay)
60
61 def _save_grad_output(self, module, grad_input, grad_output):
62 # Accumulate statistics for Fisher matrices

Callers

nothing calls this directly

Calls 1

update_running_statFunction · 0.90

Tested by

no test coverage detected