From 30ba781cf70dd660a6b6c96e658d948b48106ea2 Mon Sep 17 00:00:00 2001 From: Mickus Timothee Date: Mon, 25 Sep 2023 10:42:13 +0300 Subject: [PATCH] Revert "linting and comment" This reverts commit 5763591fe28e2d5366936c47a30e483a67235d52. --- onmt/trainer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/onmt/trainer.py b/onmt/trainer.py index 7edb9039..8d210df3 100644 --- a/onmt/trainer.py +++ b/onmt/trainer.py @@ -447,11 +447,10 @@ def validate(self, valid_iter, moving_average=None, task=None): # Set model back to training mode. valid_model.train() - # the forward hook `has_grad` was triggered, so we manually unset the flags to not fool the optim for p in self.model.parameters(): if hasattr(p, 'has_grad'): p.has_grad = False - + return stats def _gradient_accumulation_over_lang_pairs(