I tried to narrow down to a simple question.



x = torch.tensor([[-1.0, 0.0], [1.0, 2.0]])
y = torch.quantize_per_channel(x, torch.tensor([0.1, 0.01]), torch.tensor([10, 0]), 0, torch.quint8)
y
tensor([[-1.,  0.],
[ 1.,  2.]], size=(2, 2), dtype=torch.quint8,
quantization_scheme=torch.per_channel_affine,
scale=tensor([0.1000, 0.0100], dtype=torch.float64),
zero_point=tensor([10,  0]), axis=0)




y.int_repr()
tensor([[  0,  10],
[100, 200]], dtype=torch.uint8)




y.q_scale()
*** RuntimeError: Expected quantizer->qscheme() == kPerTensorAffine to be true, but got false.  (Could this error message be improved?  If so, please report an enhancement request to PyTorch.)



I installed pytorch version : 1.10.0
Thanks,
Stephen