class_docstr: Fast re-implementation of ``torch.nn.SyncBatchNorm`` that can achieve a speedup
  of 5x or more over the default implementation depending on size of the input
  and number of distributed workers.
class_docstr_tok: ["Fast","re-implementation","of","``","torch.nn.SyncBatchNorm","``","that","can","achieve","a","speedup","of","5x","or","more","over","the","default","implementation","depending","on","size","of","the","input","and","number","of","distributed","workers","."]
code: def __init__(
      self,
      *args: Tuple[Any, ...],
      process_group: Optional[ProcessGroup] = None,
      **kwargs: Dict[str, Any],
  ) -> None:
      super().__init__(*args, **kwargs)  # type: ignore
      self._process_group = (
          process_group
          if process_group is not None
          else dist.group.WORLD
      )
      self.saved_for_2nd_fwd: List[Tuple] = []
      self.disable_patch_batchnorm = True
  
file_path: fairscale/fairscale/experimental/nn/sync_batchnorm.py
imports: from typing import Any, Dict, List, Optional, Tuple
  import torch
  from torch import Tensor
  import torch.distributed
  from torch.distributed import ProcessGroup
  from fairscale.internal import torch_version
  from fairscale.nn.checkpoint import is_checkpointing, is_recomputing
label_desc: Use image node_id 1 to create a new SyncBatchNorm object from inherited base classes: torch.nn with example: obj = SyncBatchNorm()