Hi @jerryzh168, yes. Updated initially to 1.7.0.dev20200705+cpu and just tried torch-1.7.0.dev20200724+cpu. No luck with either.
As I hijacked an old thread, I thought best to raise a separate issue with a simple example (single fully connected layer) to replicate -

  
    
    
    Simple quantized model doesn't export to ONNX quantization
  
  
    Hello, I’m having problems exporting a very simple quantized model to ONNX. The error message I’m seeing is - 
AttributeError: 'torch.dtype' object has no attribute 'detach' 
The cause of this is that (‘fc1._packed_params.dtype’, torch.qint8) is ends up in the state_dict. 
I asked on a previous (and old) thread if there was a solution and the answer was that this could be solved in the latest version of PyTorch. So I installed 1.7.0.dev20200705+cpu, but no joy. 
I’ve pasted the example below. 
A…
  


I’ve had one reply with comment explaining that exporting of quantized models is not yet supported and a link to another thread. Sounds like it’s WIP. Would be good to get your take on the example in the other thread.
Many thanks again.