Add the explicit per-tensor/per-channel quant info when we print the module (#30591)
Summary:
As Title says. We would like to explicitly distinguish per-tensor/per-channel scheme when we print the module.
Here is an example for Lenet after applying the per-channel dynamic quantization:
Before this PR:
```
FloatModel(
(conv1): Conv2d(1, 20, kernel_size=(5, 5), stride=(1, 1))
(conv2): Conv2d(20, 50, kernel_size=(5, 5), stride=(1, 1))
(fc1): DynamicQuantizedLinear(
in_features=800, out_features=500
(_packed_params): LinearPackedParams()
)
(fc2): DynamicQuantizedLinear(
in_features=500, out_features=10
(_packed_params): LinearPackedParams()
)
)
```
After this PR:
```
FloatModel(
(conv1): Conv2d(1, 20, kernel_size=(5, 5), stride=(1, 1))
(conv2): Conv2d(20, 50, kernel_size=(5, 5), stride=(1, 1))
(fc1): DynamicQuantizedLinear(
in_features=800, out_features=500, qscheme=torch.per_channel_affine
(_packed_params): LinearPackedParams()
)
(fc2): DynamicQuantizedLinear(
in_features=500, out_features=10, qscheme=torch.per_channel_affine
(_packed_params): LinearPackedParams()
)
)
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30591
Differential Revision: D18764366
Pulled By: jianyuh
fbshipit-source-id: e897ab42ace6b82b2a90729ba788313c7873de1a