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\/",">","`","_"]
code: def world_size(self) -> int:
      return int(os.environ["WORLD_SIZE"])
  
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 5 for calling the TorchElasticEnvironment obj's underlying member method code with example usage: obj.world_size() and returns: int