code: def _prepare_qat_linears(self, model):
      for name, child in model.named_children():
          if isinstance(
              child,
              (torch.nn.Linear, TestQuantizeMixQATAndPTQ.TwoLinear),
          ):
              if isinstance(child, torch.nn.Linear):
                  in_channels = child.weight.size(1)
              else:
                  in_channels = child.linear1.weight.size(1)
  
              example_input = (torch.rand((1, in_channels)),)
              traced_child = capture_pre_autograd_graph(
                  child, example_input
              )
              quantizer = XNNPACKQuantizer()
              quantization_config = get_symmetric_quantization_config(
                  is_per_channel=True, is_qat=True
              )
              quantizer.set_global(quantization_config)
              traced_child_prepared = prepare_qat_pt2e(
                  traced_child, quantizer
              )
              setattr(model, name, traced_child_prepared)
          else:
              self._prepare_qat_linears(child)
  
imports: import copy
  import operator
  import unittest
  from typing import Any, Optional, Tuple, Type
  import torch
  from torch._export import capture_pre_autograd_graph
  from torch.ao.quantization import default_fake_quant, FusedMovingAvgObsFakeQuantize, MovingAverageMinMaxObserver, MovingAveragePerChannelMinMaxObserver, QConfigMapping
  from torch.ao.quantization.backend_config import get_qnnpack_backend_config
  from torch.ao.quantization.qconfig import default_per_channel_symmetric_qnnpack_qat_qconfig, default_symmetric_qnnpack_qat_qconfig
  from torch.ao.quantization.quantize_fx import prepare_qat_fx
  from torch.ao.quantization.quantize_pt2e import _convert_to_reference_decomposed_fx, convert_pt2e, prepare_pt2e, prepare_qat_pt2e
  from torch.ao.quantization.quantizer import DerivedQuantizationSpec, QuantizationAnnotation, QuantizationSpec, Quantizer
  from torch.ao.quantization.quantizer.xnnpack_quantizer import get_symmetric_quantization_config, XNNPACKQuantizer
  from torch.testing._internal.common_cuda import TEST_CUDA
  from torch.testing._internal.common_quantization import NodeSpec, QuantizationTestCase, skip_if_no_torchvision, skipIfNoQNNPACK
  from torch.testing._internal.common_quantized import override_quantized_engine
label_desc: Use image node_id 1 for calling the TestQuantizeMixQATAndPTQ obj's underlying member method code with example usage: obj._prepare_qat_linears(model) without return types