fx quant: clean up functions in _generate_qconfig_map (#48772)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/48772
Makes util functions in `_generate_qconfig_map` have no side
effects, all dependencies are now in arguments.
Test Plan:
```
python test/test_quantization.py TestQuantizeFx
```
Imported from OSS
Reviewed By: jerryzh168
Differential Revision: D25295837
fbshipit-source-id: 49399abef626234e34bb5ec8c6d870da3c1760e7