From f5609be40a28228a53efde9a299d1c4e47fe4a4b Mon Sep 17 00:00:00 2001 From: Kaushik B <45285388+kaushikb11@users.noreply.github.com> Date: Mon, 1 Nov 2021 22:23:46 +0530 Subject: [PATCH] Remove unnecessary NotImplementedError used in Training Type Plugin (#10235) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Adrian Wälchli --- pytorch_lightning/plugins/training_type/parallel.py | 2 +- .../plugins/training_type/training_type_plugin.py | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pytorch_lightning/plugins/training_type/parallel.py b/pytorch_lightning/plugins/training_type/parallel.py index e6406ea444..4f4b2c5b8e 100644 --- a/pytorch_lightning/plugins/training_type/parallel.py +++ b/pytorch_lightning/plugins/training_type/parallel.py @@ -44,7 +44,7 @@ class ParallelPlugin(TrainingTypePlugin, ABC): @property @abstractmethod def root_device(self) -> torch.device: - raise NotImplementedError + """Return the root device.""" @property def on_gpu(self) -> bool: diff --git a/pytorch_lightning/plugins/training_type/training_type_plugin.py b/pytorch_lightning/plugins/training_type/training_type_plugin.py index 585c8b6405..a1e55631c2 100644 --- a/pytorch_lightning/plugins/training_type/training_type_plugin.py +++ b/pytorch_lightning/plugins/training_type/training_type_plugin.py @@ -86,19 +86,16 @@ class TrainingTypePlugin(ABC): @abstractmethod def on_gpu(self) -> bool: """Returns whether the current process is done on GPU.""" - raise NotImplementedError @property @abstractmethod def on_tpu(self) -> bool: """Returns whether the current process is done on TPU.""" - raise NotImplementedError @property @abstractmethod def root_device(self) -> torch.device: """Returns the root device.""" - raise NotImplementedError @abstractmethod def model_to_device(self) -> None: @@ -321,7 +318,6 @@ class TrainingTypePlugin(ABC): It is the right place to release memory and free other resources. """ - raise NotImplementedError @classmethod def register_plugins(cls, plugin_registry) -> None: