def METHOD_NAME(self):
    model = resnet18()
    conv_count = self._count_layers(model, paddle.nn.Conv2D)
    quanter = FakeQuanterWithAbsMaxObserver(moving_rate=0.9)
    q_config = QuantConfig(activation=quanter, weight=quanter)
    # It will freeze the batch normaliztion after 'freeze_bn_delay' steps
    q_config.add_constraints(FreezedConvBNConstraint(freeze_bn_delay=1))
    qat = SlimQAT(q_config)
    x = paddle.rand([1, 3, 224, 224])
    paddle.jit.save(model, "./test_model", input_spec=[x])
    quant_model = qat.quantize(model, inplace=True, inputs=x)
    # check freeze_bn_delay
    qat_conv_bn_layer = self._get_one_layer(quant_model,
                                            QuantedConv2DBatchNorm)
    self.assertIsNotNone(qat_conv_bn_layer)
    self.assertFalse(qat_conv_bn_layer._freeze_bn)
    quant_model.train()
    out = quant_model(x)
    out.backward()
    out = quant_model(x)
    out.backward()
    self.assertTrue(qat_conv_bn_layer._freeze_bn)
    # check the count of QAT layers in QAT model
    qat_layer_count = self._count_layers(quant_model,
                                         QuantedConv2DBatchNorm)
    self.assertEqual(qat_layer_count, conv_count)
    # check the count of convolution and batch norm in saved static graph
    quant_model.eval()
    infer_model = qat.convert(quant_model, inplace=True)
    save_path = os.path.join(self.path, 'infer_model')
    paddle.jit.save(infer_model, save_path, input_spec=[x])
    layer2count = load_model_and_count_layer(save_path,
                                             ['conv2d', 'batch_norm'])
    self.assertEqual(layer2count['conv2d'], conv_count)
    self.assertEqual(layer2count['batch_norm'], 0)