code: def skip_quant(model):
      """
      If the model has backbone and head, we skip quantizing the conv2d and linear ops
      that belongs the head.
      """
      if not hasattr(model, "backbone"):
          logger.info("Quantize all target ops")
          return
  
      logger.info("Quantize all target ops in backbone")
      for name, cur_layer in model.named_sublayers():
          if (
              isinstance(
                  cur_layer, (paddle.nn.Conv2D, paddle.nn.Linear)
              )
              and "backbone" not in name
          ):
              cur_layer.skip_quant = True
  
file_path: PaddleSeg/deploy/slim/quant/qat_train.py
imports: import argparse
  import random
  import paddle
  import numpy
  from paddleslim import QAT
  from paddleseg.cvlibs import Config, SegBuilder
  from paddleseg.core import train
  from paddleseg.utils import get_sys_env, logger, utils
  from qat_config import quant_config
label_desc: Use image node_id 2 for calling a global function with example usage: skip_quant(model) without return types