Yes, it’s quite hacky… indeed, it only works for dynamic quantization (quantizing only the weights)
I’m very interested in placing the quantsub and dequantsub to avoid quantization, could you please provide a pice of code?
Do you mean something like this:
# y and x Tensors previouslly created...
x = torch.quantization.DeQuantStub(x)
y = torch.quantization.DeQuantStub(y)
Y = torch.torch.bmm(y, x)
y = torch.quantization.QuantStub(y)

Thx you very much!