@jerryzh168
Thank you so much for your help. Your solution works!
Then I tried to port my resulting quantized_model to RKNN h/w and it requires to
trace_model = torch.jit.trace(quantized_model, torch.Tensor(1,3,300,300))
before it can convert the quantized_model into rknn model. But when run the torch.jit.trace, I encountered the following error:
RuntimeError: Tracer cannot infer type of <map object at 0x7f308b270cc0>
:Only tensors and (possibly nested) tuples of tensors, lists, or dictsare supported as inputs or outputs of traced functions, but instead got value of type map.

I believe it is the x=map(self.dequant, x) we just introduced to solve the previous problem.
I wonder is there a way to get the torch.jit.trace to work for this case? Thanks a lot for your help again.