Hello Jerry, thanks for reply!
I have check the test doing fusion, but I still have some quesion
Here is my model before fused
CNN(
  (conv1): ConvBNReLU(
    (0): Conv2d(3, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
    (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (2): ReLU()
  )
  (conv2): ConvBNReLU(
    (0): Conv2d(16, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
    (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
    (2): ReLU()
  )
  (quant): QuantStub()
  (dequant): DeQuantStub()
  (out): Linear(in_features=32768, out_features=10, bias=True)
)


And here is after fused
CNN(
  (conv1): ConvBNReLU(
    (0): ConvBnReLU2d(
      (0): Conv2d(3, 16, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
      (1): BatchNorm2d(16, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
    )
    (1): Identity()
    (2): Identity()
  )
  (conv2): ConvBNReLU(
    (0): ConvBnReLU2d(
      (0): Conv2d(16, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1), bias=False)
      (1): BatchNorm2d(32, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
      (2): ReLU()
    )
    (1): Identity()
    (2): Identity()
  )
  (quant): QuantStub()
  (dequant): DeQuantStub()
  (out): Linear(in_features=32768, out_features=10, bias=True)
)


It seems like conv BN ReLU have been converted to ConvBNReLU2d, did I miss anything?
I’m doing with post training, is it only conv ReLU can be quantized?
And the model in section “Define dataset and data loaders”(https://pytorch.org/tutorials/advanced/static_quantization_tutorial.html#define-dataset-and-data-loaders)
I am confused why the model before fusion is conv BN ReLU, but after fusion it turned out only ConvReLU2d.
Did it remove BN while doing fusion?