class_docstr: Environment for fault-tolerant and elastic training with `torchelastic <https://pytorch.org/elastic/>`_
class_docstr_tok: ["Environment","for","fault-tolerant","and","elastic","training","with","`","torchelastic","<","https",":","\/\/pytorch.org\/elastic\/",">","`","_"]
docstr: Returns ``True`` if the current process was launched using the torchelastic command.
docstr_tok: ["Returns","``","True","``","if","the","current","process","was","launched","using","the","torchelastic","command","."]
code: def detect() -> bool:
      """Returns ``True`` if the current process was launched using the torchelastic command."""
      # if not available (for example on MacOS), `is_torchelastic_launched` is not defined
      return (
          torch.distributed.is_available()
          and torch.distributed.is_torchelastic_launched()
      )
  
file_path: pytorch-lightning/src/lightning/fabric/plugins/environments/torchelastic.py
imports: import logging
  import os
  import torch.distributed
  from typing_extensions import override
  from lightning.fabric.plugins.environments.cluster_environment import ClusterEnvironment
  from lightning.fabric.utilities.rank_zero import rank_zero_warn
label_desc: Use image node_id 4 for calling the TorchElasticEnvironment obj's underlying member method code with example usage: obj.detect() and returns: unknown