class_docstr: Naive version of Synchronized 3D BatchNorm. See details in
  NaiveSyncBatchNorm2d above.
  Args:
      num_sync_devices (int): number of (local) devices to sync.
      global_sync (bool): sync across all devices (on all machines).
      args (list): other arguments.
class_docstr_tok: ["Naive","version","of","Synchronized","3D","BatchNorm",".","See","details","in","NaiveSyncBatchNorm2d","above",".","Args",":","num_sync_devices","(","int",")",":","number","of","(","local",")","devices","to","sync",".","global_sync","(","bool",")",":","sync","across","all","devices","(","on","all","machines",")",".","args","(","list",")",":","other","arguments","."]
code: def __init__(self, num_sync_devices=None, global_sync=True, **args):
      self.global_sync = global_sync
      if self.global_sync and num_sync_devices is not None:
          raise ValueError(
              f"Cannot set num_sync_devices separately when global_sync = {self.global_sync}"
          )
      if not self.global_sync and num_sync_devices is None:
          raise ValueError(
              f"num_sync_devices cannot be None when global_sync = {self.global_sync}"
          )
  
      if not self.global_sync:
          self.num_sync_devices = num_sync_devices
          if self.num_sync_devices > 0:
              assert du.get_local_size() % self.num_sync_devices == 0, (
                  du.get_local_size(),
                  self.num_sync_devices,
              )
              self.num_groups = (
                  du.get_local_size() // self.num_sync_devices
              )
          else:
              self.num_sync_devices = du.get_local_size()
              self.num_groups = 1
      super(NaiveSyncBatchNorm3d, self).__init__(**args)
  
file_path: pytorchvideo/pytorchvideo/layers/batch_norm.py
imports: import pytorchvideo.layers.distributed
  import torch
  import torch.distributed
  from fvcore.nn.distributed import differentiable_all_reduce
  from torch import nn
label_desc: Use image node_id 1 to create a new NaiveSyncBatchNorm3d object from inherited base classes: nn with example: obj = NaiveSyncBatchNorm3d(num_sync_devices, global_sync)