Repository: pytorch
Issue: [Tracker] AO migration of quantization from `torch.nn` to `torch.ao.nn`
Labels: oncall: quantization,low priority,triaged

## Motivation

There are several locations under the `torch.nn` that are related to the quantization. In order to reduce the cluttering and "takeover" by the quantization, the nn modules that are relevant are being migrated to `torch.ao`.

## Timeline

### Upcoming deadlines

- [x] 08/2022: Migration of the code from `torch.nn` to `torch.ao.nn`. At this point both location could be used, while the old location would have `from torch.ao... import ...`
- [x] 08/2022: Importing from the `torch.nn` would show a deprecation warning
- [ ] PyTorch 1.14 ~~1.13~~: Documentation updated from old locations to AO locations
- [ ] PyTorch 1.14 ~~1.13~~: Tutorials updated from old locations to AO locations
- [ ] PyTorch 1.14 ~~1.13~~: The deprecation warning is shown
- [ ] PyTorch 1.14+: The deprecation error is shown
- [ ] PyTorch 1.14+: The `torch.nn` location is cleaned up and not usable anymore.

### TODOs

- [ ] All docstrings within `torch.ao` are up to date (classes and functions)
   - Note: If not cleaned up, these will generate a lot of duplicates under the `generated`
   - Example: https://github.com/pytorch/pytorch/blob/015b05af18b78ca9c77c997bc277eec66b5b1542/torch/ao/nn/quantized/dynamic/modules/conv.py#L22
- [ ] The documentation in the `docs` is only referring to the `torch.ao` for quantization related stuff
   - Note: There are a lot of `:noindex:` in the documentation that need to be cleaned up 
   - Note: There are a lot of `.. py::module::` in the documentation that need to be cleaned up
   - Example: https://github.dev/pytorch/pytorch/blob/015b05af18b78ca9c77c997bc277eec66b5b1542/docs/source/quantization-support.rst#L410
- [ ] Tutorials that are using the `torch.ao`
  - [ ] https://pytorch.org/tutorials/intermediate/realtime_rpi.html
  - [ ] https://pytorch.org/tutorials/advanced/dynamic_quantization_tutorial.html
  - [ ] https://pytorch.org/tutorials/intermediate/dynamic_quantization_bert_tutorial.html
  - [ ] https://pytorch.org/tutorials/intermediate/quantized_transfer_learning_tutorial.html
  - [ ] https://pytorch.org/tutorials/advanced/static_quantization_tutorial.html
- [ ] Blog posts
  - Note: THis is one of the blog posts: https://pytorch.org/blog/introduction-to-quantization-on-pytorch/

### Complete

- [x] `torch.nn.quantized` → `torch.ao.nn.quantized`
  - [x] [`torch.nn.quantized.functional` → `torch.ao.nn.quantized.functional`](https://github.com/pytorch/pytorch/pull/78712)
  - [x] [`torch.nn.quantized.modules` → `torch.ao.nn.quantized.modules`](https://github.com/pytorch/pytorch/pull/78713)
  - [x] [`torch.nn.quantized.dynamic` → `torch.ao.nn.quantized.dynamic`](https://github.com/pytorch/pytorch/pull/78714)
  - [x] [`torch.nn.quantized._reference` → `torch.ao.nn.quantized._reference`](https://github.com/pytorch/pytorch/pull/78715)
- [x] [`torch.nn.quantizable` → `torch.ao.nn.quantizable`](https://github.com/pytorch/pytorch/pull/78717)
- [x] [`torch.nn.qat` → `torch.ao.nn.qat`](https://github.com/pytorch/pytorch/pull/78716)
  - [x] `torch.nn.qat.modules` → `torch.ao.nn.qat.modules`
  - [x] `torch.nn.qat.dynamic` → `torch.ao.nn.qat.dynamic`
- [x] `torch.nn.intrinsic` → `torch.ao.nn.intrinsic`
  - [x] [`torch.nn.intrinsic.modules` → `torch.ao.nn.intrinsic.modules`](https://github.com/pytorch/pytorch/pull/84842)
  - [x] [`torch.nn.intrinsic.qat` → `torch.ao.nn.intrinsic.qat`](https://github.com/pytorch/pytorch/pull/86171)
  - [x] [`torch.nn.intrinsic.quantized` → `torch.ao.nn.intrinsic.quantized`](https://github.com/pytorch/pytorch/pull/86172)
    - [x] `torch.nn.intrinsic.quantized.modules` → `torch.ao.nn.intrinsic.quantized.modules`
    - [x] `torch.nn.intrinsic.quantized.dynamic` → `torch.ao.nn.intrinsic.quantized.dynamic`

## Blockers

1. Preserving the blame history
    1. Currently, we are pushing for the internal blame history preservation, as the sync between internal and external history post-migration proves to be non-trivial

cc @jerryzh168 @jianyuh @raghuramank100 @jamesr66a @vkuzo @jgong5 @Xia-Weiwen @leslie-fang-intel @anjali411 @albanD