Skip to content

Commit 36d192e

Browse files
Update pytorch_lightning/plugins/training_type/training_type_plugin.py
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
1 parent 3939673 commit 36d192e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

pytorch_lightning/plugins/training_type/training_type_plugin.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ def results(self) -> Optional[Union[_EVALUATE_OUTPUT, _PREDICT_OUTPUT]]:
155155
return self._results
156156

157157
def load_checkpoint(self, checkpoint_path: Union[str, Path]) -> Dict[str, Any]:
158-
if self.on_gpu:
159-
torch.cuda.empty_cache()
158+
torch.cuda.empty_cache()
160159
return self.checkpoint_io.load_checkpoint(checkpoint_path)
161160

162161
def load_model_state_dict(self, checkpoint: Mapping[str, Any]) -> None:

0 commit comments

Comments
 (0)