code: def bn_re_estimate(loader, model):
      if not check_bn(model):
          print("No batch norm layer detected")
          return
      model.train()
      momenta = {}
      model.apply(reset_bn)
      model.apply(lambda module: _get_momenta(module, momenta))
      n = 0
      for i_iter, batch in enumerate(loader):
          # images, labels, edges, _ = batch
          images = batch[0]
          b = images.data.size(0)
          momentum = b / (n + b)
          for module in momenta.keys():
              module.momentum = momentum
          model(images)
          n += b
      model.apply(lambda module: _set_momenta(module, momenta))
  
file_path: insightface/parsing/dml_csr/utils/schp.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import torch
label_desc: Use image node_id 7 for calling a global function with example usage: bn_re_estimate(loader, model) without return types