class_docstr: Base class for distributed computation models and defines interface methods.
  This class is public and should be used for other custom derived distributed models.
class_docstr_tok: ["Base","class","for","distributed","computation","models","and","defines","interface","methods",".","This","class","is","public","and","should","be","used","for","other","custom","derived","distributed","models","."]
code: def all_gather(
      self,
      tensor: Union[torch.Tensor, float, str, Any],
      group: Optional[Any] = None,
  ) -> Union[torch.Tensor, float, List[float], List[str], List[Any]]:
      if not isinstance(tensor, (torch.Tensor, Number, str)):
          return self._do_all_gather_object(tensor, group=group)
  
      return self._collective_op(
          tensor, self._do_all_gather, group=group
      )
  
imports: from abc import ABCMeta, abstractmethod
  from numbers import Number
  from typing import Any, Callable, cast, List, Optional, Union
  import torch
  from packaging.version import Version
label_desc: Use image node_id 25 for calling the ComputationModel obj's underlying member method code with example usage: obj.all_gather(tensor, group) and returns: self, self