we have examples for qat.Conv2d here: pytorch/conv.py at master · pytorch/pytorch · GitHub
then you can add the mapping in:
  
      github.com
  
  
    pytorch/pytorch/blob/master/torch/quantization/quantization_mappings.py#L68

    nniqat.ConvBnReLU1d: nniq.ConvReLU1d,    nniqat.ConvBnReLU2d: nniq.ConvReLU2d,    nniqat.ConvReLU2d: nniq.ConvReLU2d,    nniqat.LinearReLU: nniq.LinearReLU,    # QAT modules:    nnqat.Linear: nnq.Linear,    nnqat.Conv2d: nnq.Conv2d,}# Default map for swapping float module to qat modulesDEFAULT_QAT_MODULE_MAPPINGS : Dict[Callable, Any] = {    nn.Conv2d: nnqat.Conv2d,    nn.Linear: nnqat.Linear,    nn.modules.linear._LinearWithBias: nnqat.Linear,    # Intrinsic modules:    nni.ConvBn1d: nniqat.ConvBn1d,    nni.ConvBn2d: nniqat.ConvBn2d,    nni.ConvBnReLU1d: nniqat.ConvBnReLU1d,    nni.ConvBnReLU2d: nniqat.ConvBnReLU2d,    nni.ConvReLU2d: nniqat.ConvReLU2d,    nni.LinearReLU: nniqat.LinearReLU



  
  
    
    
  
  


or pass in a mapping that includes the new qat module in pytorch/quantize.py at master · pytorch/pytorch · GitHub 2