code: def test_bn_move_exported_model_to_eval(self):
      class M(torch.nn.Module):
          def __init__(
              self,
          ):
              super().__init__()
              self.bn = torch.nn.BatchNorm2d(3)
              self.conv = torch.nn.Conv2d(3, 3, 3)
  
          def forward(self, x):
              return self.conv(self.bn(x))
  
      m = M().train()
      example_inputs = (
          torch.randn(
              (1, 3, 8, 8), dtype=torch.float32, requires_grad=True
          ).add(1),
      )
  
      m = capture_pre_autograd_graph(m, example_inputs)
  
      # Assert that bn op exists and is in train mode
      batch_norm_node = None
      for n in m.graph.nodes:
          if (
              n.target
              == torch.ops.aten._native_batch_norm_legit.default
          ):
              batch_norm_node = n
              break
      self.assertTrue(batch_norm_node is not None)
      self.assertTrue(batch_norm_node.args[5])
  
      # Do the subgraph rewriting
      torch.ao.quantization.move_exported_model_to_eval(m)
  
      # Assert that bn op is now in eval mode
      targets = [n.target for n in m.graph.nodes]
      self.assertTrue(
          torch.ops.aten._native_batch_norm_legit.default not in targets
      )
      self.assertTrue(
          torch.ops.aten._native_batch_norm_legit_no_training.default
          in targets
      )
  
imports: from typing import List, Tuple
  import torch
  from torch._export import capture_pre_autograd_graph
  from torch import Tensor
  from torch.ao.quantization import observer, ObserverOrFakeQuantize, QConfigMapping
  from torch.ao.quantization.quantizer import DerivedQuantizationSpec, FixedQParamsQuantizationSpec, QuantizationAnnotation, QuantizationSpec, Quantizer, SharedQuantizationSpec
  from torch.ao.quantization.quantizer.xnnpack_quantizer import XNNPACKQuantizer, get_symmetric_quantization_config
  from torch.ao.quantization.quantizer.xnnpack_quantizer_utils import OP_TO_ANNOTATOR, QuantizationConfig
  from torch.ao.quantization.quantizer.composable_quantizer import ComposableQuantizer
  from torch.ao.quantization.quantizer.embedding_quantizer import EmbeddingQuantizer
  from torch.ao.quantization.quantize_pt2e import convert_pt2e, prepare_pt2e, prepare_qat_pt2e
  from torch.ao.quantization.qconfig import default_per_channel_symmetric_qnnpack_qconfig, float_qparams_weight_only_qconfig, per_channel_weight_observer_range_neg_127_to_127, QConfig, weight_observer_range_neg_127_to_127
  from torch.fx import Node
  from torch.testing._internal.common_quantization import NodeSpec, PT2EQuantizationTestCase, skipIfNoQNNPACK, TestHelperModules
  from torch.testing._internal.common_utils import TemporaryFileName
label_desc: Use image node_id 26 for calling the TestQuantizePT2E obj's underlying member method code with example usage: obj.test_bn_move_exported_model_to_eval() and returns: self