code: def _compare_bn_stats(self, stats_1, stats_2):
      # make sure the stats are non empty
      self.assertGreater(len(stats_1), 0)
      for name in stats_1:
          if not torch.allclose(
              stats_1[name]["mean"], stats_2[name]["mean"]
          ) or not torch.allclose(
              stats_1[name]["var"], stats_2[name]["var"]
          ):
              return False
      return True
  
file_path: ClassyVision/test/hooks_precise_batch_norm_hook_test.py
imports: import copy
  import torch
  import torch.nn
  from classy_vision.hooks import ClassyHook
  from classy_vision.hooks.precise_batch_norm_hook import PreciseBatchNormHook
  from classy_vision.tasks import build_task
  from classy_vision.trainer import ClassyTrainer
  from test.generic.config_utils import get_test_mlp_task_config
  from test.generic.hook_test_utils import HookTestBase
label_desc: Use image node_id 2 for calling the TestPreciseBatchNormHook obj's underlying member method code with example usage: obj._compare_bn_stats(stats_1, stats_2) and returns: True, False