This commit is contained in:
HuguesTHOMAS 2021-09-27 11:30:10 -04:00
parent cf1f06381e
commit 73e444d486

View file

@ -198,6 +198,9 @@ class ModelTrainer:
#torch.nn.utils.clip_grad_norm_(net.parameters(), config.grad_clip_norm)
torch.nn.utils.clip_grad_value_(net.parameters(), config.grad_clip_norm)
self.optimizer.step()
torch.cuda.empty_cache()
torch.cuda.synchronize(self.device)
t += [time.time()]