fake_quant: make qparams shape consistent (#38587)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38587
Before this diff, scale+zp were initialized to tensors
with a single dimension and 1 element, and then switched
to scalar tensors after the first forward.
This diff makes the shape stay consistent. This should fix
an issue reported when saving/loading models, which crashes
on this inconsistent shape.
Test Plan:
```
python test/test_quantization.py TestFakeQuantizePerTensor.test_fake_quant_preserves_qparam_shapes_for_activations
```
Imported from OSS
Differential Revision: D21605532
fbshipit-source-id: e00cd268d6d3ded1006d18d6c6759c911b3a74ea