class_docstr: A plugin that wraps all batch normalization layers of a model with synchronization logic for multiprocessing.
  
  This plugin has no effect in single-device operation.
docstr: Add global batchnorm for a model spread across multiple GPUs and nodes.
  
  Override this method to synchronize batchnorm layers between specific process groups instead
  of the whole world.
  
  Args:
      model: Reference to the current LightningModule
  
  Return:
      LightningModule with batchnorm layers synchronized within the process groups.
docstr_tok: ["Add","global","batchnorm","for","a","model","spread","across","multiple","GPUs","and","nodes",".","Override","this","method","to","synchronize","batchnorm","layers","between","specific","process","groups","instead","of","the","whole","world",".","Args",":","model",":","Reference","to","the","current","LightningModule","Return",":","LightningModule","with","batchnorm","layers","synchronized","within","the","process","groups","."]
code: def apply(self, model: Module) -> Module:
      """Add global batchnorm for a model spread across multiple GPUs and nodes.
  
      Override this method to synchronize batchnorm layers between specific process groups instead
      of the whole world.
  
      Args:
          model: Reference to the current LightningModule
  
      Return:
          LightningModule with batchnorm layers synchronized within the process groups.
  
      """
      return torch.nn.SyncBatchNorm.convert_sync_batchnorm(model)
  
file_path: pytorch-lightning/src/lightning/pytorch/plugins/layer_sync.py
imports: from abc import ABC, abstractmethod
  import torch
  from torch import Tensor
  from torch.nn import Module
  from typing_extensions import override
label_desc: Use image node_id 1 for calling the TorchSyncBatchNorm obj's underlying member method code with example usage: obj.apply(model) and returns: torch