A context manager that places a model into evaluation mode and restores the previous mode on exit.
(model)
| 81 | |
| 82 | |
| 83 | def eval_mode(model): |
| 84 | """A context manager that places a model into evaluation mode and restores |
| 85 | the previous mode on exit.""" |
| 86 | return train_mode(model, False) |
| 87 | |
| 88 | |
| 89 | @torch.no_grad() |
nothing calls this directly
no test coverage detected