Exemplo n.º 1
0
 def _select_environment(self):
     if self.trainer.plugin_connector.cloud_environment:
         env = self.trainer.plugin_connector.cloud_environment
     elif self.trainer.is_slurm_managing_tasks:
         env = SLURMEnvironment()
     elif self._is_using_torchelastic():
         env = TorchElasticEnvironment()
     else:
         env = TorchElasticEnvironment()
     return env
    def _select_environment(self):
        env = None

        # in priority: user environment, torchelastic (which is a generic environment), slurm
        if self.cluster_environment is not None:
            env = self.cluster_environment
        elif self._is_using_torchelastic():
            env = TorchElasticEnvironment()
        elif self.trainer.is_slurm_managing_tasks:
            env = SLURMEnvironment()
        return env