From 1b86ed9cc320ee2cde67a0ca268cf9acd39e6c62 Mon Sep 17 00:00:00 2001 From: William Falcon Date: Sat, 7 Dec 2019 23:31:47 -0500 Subject: [PATCH] refactor --- pytorch_lightning/trainer/trainer.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/trainer/trainer.py b/pytorch_lightning/trainer/trainer.py index 631bcb5a..59ca0d57 100644 --- a/pytorch_lightning/trainer/trainer.py +++ b/pytorch_lightning/trainer/trainer.py @@ -139,19 +139,24 @@ class Trainer(TrainerIOMixin, """ # Transfer params - if nb_gpu_nodes is not None: # Backward compatibility + # Backward compatibility + if nb_gpu_nodes is not None: warnings.warn("`nb_gpu_nodes` has renamed to `num_nodes` since v0.5.0" " and will be removed in v0.8.0", DeprecationWarning) if not num_nodes: # in case you did not set the proper value num_nodes = nb_gpu_nodes self.num_gpu_nodes = num_nodes + self.log_gpu_memory = log_gpu_memory - if gradient_clip is not None: # Backward compatibility + + # Backward compatibility + if gradient_clip is not None: warnings.warn("`gradient_clip` has renamed to `gradient_clip_val` since v0.5.0" " and will be removed in v0.8.0", DeprecationWarning) if not gradient_clip_val: # in case you did not set the proper value gradient_clip_val = gradient_clip self.gradient_clip_val = gradient_clip_val + self.check_val_every_n_epoch = check_val_every_n_epoch self.track_grad_norm = track_grad_norm self.on_gpu = True if (gpus and torch.cuda.is_available()) else False