docstr: TwoLayerLinearModel has two Linear modules but we only quantize the second one
  `fc2`, and `fc1`is not quantized
docstr_tok: ["TwoLayerLinearModel","has","two","Linear","modules","but","we","only","quantize","the","second","one","`","fc2","`",",","and","`","fc1","`","is","not","quantized"]
code: def test_two_layers(self):
      r"""TwoLayerLinearModel has two Linear modules but we only quantize the second one
      `fc2`, and `fc1`is not quantized
      """
      with override_quantized_engine("fbgemm"):
          model = AnnotatedTwoLayerLinearModel()
          model = prepare(model)
  
          self.checkNoPrepModules(model)
          self.checkObservers(model)
          self.checkNoPrepModules(model.fc1)
          self.checkHasPrepModules(model.fc2)
  
          test_only_eval_fn(model, self.calib_data)
          model = convert(model)
  
          def checkQuantized(model):
              self.checkNoPrepModules(model)
              self.checkNoPrepModules(model.fc1)
              self.checkHasPrepModules(model.fc2)
              self.assertEqual(type(model.fc1), torch.nn.Linear)
              self.checkWrappedQuantizedLinear(model.fc2)
              test_only_eval_fn(model, self.calib_data)
              self.checkScriptable(model, self.calib_data)
              self.checkNoQconfig(model)
  
          checkQuantized(model)
  
          # test one line API
          model = quantize(
              AnnotatedTwoLayerLinearModel(),
              test_only_eval_fn,
              [self.calib_data],
          )
          checkQuantized(model)
  
imports: import torch
  import torch.nn
  import torch.ao.nn.quantized
  from torch.nn.utils.rnn import PackedSequence
  from torch.ao.quantization import quantize, prepare, convert, prepare_qat, quantize_dynamic, QuantWrapper, QuantStub, DeQuantStub, default_qconfig, default_dynamic_qconfig, per_channel_dynamic_qconfig, float16_dynamic_qconfig, float_qparams_weight_only_qconfig, float_qparams_weight_only_qconfig_4bit, FixedQParamsObserver, PerChannelMinMaxObserver, default_dynamic_quant_observer, default_weight_observer, QConfig
  from torch.testing._internal.common_quantization import QuantizationTestCase, AnnotatedSingleLayerLinearModel, QuantStubModel, ModelWithFunctionals, SingleLayerLinearDynamicModel, TwoLayerLinearModel, NestedModel, ResNetBase, RNNDynamicModel, RNNCellDynamicModel, ActivationsTestModel, NormalizationTestModel, test_only_eval_fn, prepare_dynamic, convert_dynamic, skipIfNoFBGEMM, EmbeddingBagModule, EmbeddingModule, EmbeddingWithStaticLinear, LinearReluLinearModel
  from torch.testing._internal.common_quantization import AnnotatedTwoLayerLinearModel, AnnotatedNestedModel, AnnotatedSubNestedModel, AnnotatedCustomConfigNestedModel, AnnotatedSkipQuantModel
  from torch.testing._internal.common_quantized import override_quantized_engine, supported_qengines, override_qengines
  from hypothesis import given
  from hypothesis import strategies
  import torch.testing._internal.hypothesis_utils
  from typing import Tuple
  import numpy
label_desc: Use image node_id 2 for calling the TestQuantizeEagerPTQStatic obj's underlying member method code with example usage: obj.test_two_layers() without return types