[Docs] fix on_after_backward example (#5278)
* fix on_after_backward docs * doc fix
This commit is contained in:
parent
7a50c33f97
commit
5bef046759
|
@ -307,10 +307,9 @@ class ModelHooks:
|
|||
if self.trainer.global_step % 25 == 0: # don't make the tf file huge
|
||||
params = self.state_dict()
|
||||
for k, v in params.items():
|
||||
grads = v
|
||||
name = k
|
||||
self.logger.experiment.add_histogram(tag=name, values=grads,
|
||||
global_step=self.trainer.global_step)
|
||||
self.logger.experiment.add_histogram(
|
||||
tag=k, values=v.grad, global_step=self.trainer.global_step
|
||||
)
|
||||
|
||||
"""
|
||||
|
||||
|
|
Loading…
Reference in New Issue