code: def get_norm_states(module: nn.Module) -> OrderedDict:
      """Get the state_dict of batch norms in the module."""
      async_norm_states = OrderedDict()
      for name, child in module.named_modules():
          if isinstance(child, nn.modules.batchnorm._NormBase):
              for k, v in child.state_dict().items():
                  async_norm_states[".".join([name, k])] = v
      return async_norm_states
  
file_path: mmdetection/mmdet/engine/hooks/sync_norm_hook.py
imports: from collections import OrderedDict
  from mmengine.dist import get_dist_info
  from mmengine.hooks import Hook
  from torch import nn
  from mmdet.registry import HOOKS
  from mmdet.utils import all_reduce_dict
label_desc: Use image node_id 1 for calling a global function with example usage: get_norm_states(module) and returns: async_norm_states