class_docstr: Synchronize Norm states before validation, currently used in YOLOX.
docstr: Synchronizing norm.
docstr_tok: ["Synchronizing","norm","."]
code: def before_val_epoch(self, runner):
      """Synchronizing norm."""
      module = runner.model
      _, world_size = get_dist_info()
      if world_size == 1:
          return
      norm_states = get_norm_states(module)
      if len(norm_states) == 0:
          return
      # TODO: use `all_reduce_dict` in mmengine
      norm_states = all_reduce_dict(norm_states, op="mean")
      module.load_state_dict(norm_states, strict=False)
  
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 the SyncNormHook obj's underlying member method code with example usage: obj.before_val_epoch(runner) without return types