code: def test_bn_update_eval_momentum(self):
      # check that update_bn preserves eval mode
      objects = 100
      input_channels = 3
      height, width = 5, 5
      x = torch.rand(objects, input_channels, height, width)
      ds_x = torch.utils.data.TensorDataset(x)
      dl_x = torch.utils.data.DataLoader(
          ds_x, batch_size=5, shuffle=True
      )
      cnn = self.SWATestCNN(input_channels=input_channels)
      cnn.eval()
      update_bn(dl_x, cnn)
      self.assertFalse(cnn.training)
  
      # check that momentum is preserved
      self.assertEqual(cnn.bn.momentum, 0.3)
  
file_path: pytorch/test/optim/test_swa_utils.py
imports: import itertools
  import pickle
  import torch
  from torch.optim.swa_utils import AveragedModel, update_bn, get_swa_multi_avg_fn, get_ema_multi_avg_fn
  from torch.testing._internal.common_utils import TestCase, load_tests, parametrize, instantiate_parametrized_tests
label_desc: Use image node_id 11 for calling the TestSWAUtils obj's underlying member method code with example usage: obj.test_bn_update_eval_momentum() without return types