class_docstr: Collective operations using `torch.distributed <https://pytorch.org/docs/stable/distributed.html>`__.
  
  .. warning:: This is an :ref:`experimental <versioning:Experimental API>` feature which is still in development.
class_docstr_tok: ["Collective","operations","using","`","torch.distributed","<","https",":","\/\/pytorch.org\/docs\/stable\/distributed.html",">","`","__",".","..","warning",":",":","This","is","an",":","ref",":","`","experimental","<","versioning",":","Experimental","API",">","`","feature","which","is","still","in","development","."]
code: def rank(self) -> int:
      # local rank
      return dist.get_rank(self.group)
  
imports: import datetime
  import os
  from typing import Any, List, Optional, Union
  import torch
  import torch.distributed
  from torch import Tensor
  from typing_extensions import Self, override
  from lightning.fabric.plugins.collectives.collective import Collective
  from lightning.fabric.utilities.imports import _TORCH_GREATER_EQUAL_1_13
  from lightning.fabric.utilities.types import CollectibleGroup, RedOpType, ReduceOp
label_desc: Use image node_id 3 for calling the TorchCollective obj's underlying member method code with example usage: obj.rank() and returns: dist