Skip to content

Commit

Permalink
minors
Browse files Browse the repository at this point in the history
  • Loading branch information
justanhduc committed Jan 11, 2022
1 parent c629664 commit 46fc4b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions neural_monitor/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def iter_epoch(self, iterator: Iterable) -> Any:
Examples
--------
>>> from neuralnet_pytorch import monitor as mon
>>> from neural_monitor import monitor as mon
>>> mon.print_freq = 1000
>>> num_epochs = 10
>>> for epoch in mon.iter_epoch(range(mon.epoch, num_epochs))
Expand Down Expand Up @@ -638,7 +638,7 @@ def iter_batch(self, iterator: Iterable) -> Any:
Examples
--------
>>> from neuralnet_pytorch import monitor as mon
>>> from neural_monitor import monitor as mon
>>> mon.print_freq = 1000
>>> data_loader = ...
>>> num_epochs = 10
Expand Down Expand Up @@ -1726,6 +1726,7 @@ def post_hook(mod, _inputs, outputs):
hooks += [mod.register_forward_hook(post_hook) for mod in module.modules()]

# Run module.
module.eval()
module(*inputs)
for hook in hooks:
hook.remove()
Expand Down

0 comments on commit 46fc4b4

Please sign in to comment.