Error with static quantization

I tried to do static quantization of Restormer model and got the following error:

RuntimeError: Could not run ‘quantized::conv2d.new’ with arguments from the ‘CPU’ backend.

Please let me know if you have encounter the similar issue and how you resolve it.

Thanks,

please checkout Quantization — PyTorch 2.2 documentation

i’ll add, this generally happens when you didn’t put the quant stubs in the correct place and so you used a non quantized arg as input to a quantized op.