[Docs] fix on_after_backward example (#5278)

* fix on_after_backward docs

* doc fix
This commit is contained in:
Rohit Gupta 2021-01-13 05:06:13 +05:30 committed by Jirka Borovec
parent 7a50c33f97
commit 5bef046759
1 changed files with 3 additions and 4 deletions

View File

@ -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
)
"""