Skip to content

Commit f915e36

Browse files
Merge pull request #42 from williamFalcon/warning
fixed clip grad warning
2 parents c6a2544 + 483d591 commit f915e36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pytorch_lightning/models/trainer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ def __run_tng_batch(self, data_batch, batch_nb):
814814
# clip gradients
815815
if self.gradient_clip > 0:
816816
model = self.__get_model()
817-
torch.nn.utils.clip_grad_norm(model.parameters(), self.gradient_clip)
817+
torch.nn.utils.clip_grad_norm_(model.parameters(), self.gradient_clip)
818818

819819
# update gradients across all optimizers
820820
for optimizer in self.optimizers:

0 commit comments

Comments
 (0)