quantized tensor: add preliminary support for advanced indexing, try 2 (#49346)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/49346
This is less ambitious redo of
https://github.com/pytorch/pytorch/pull/49129/.
We make the
```
xq_slice = xq[:, [0], :, :]
```
indexing syntax work if `xq` is a quantized Tensor. For now, we are
making the code not crash, with an in efficient `dq -> index -> q`
implementation. A future PR can optimize performance by removing
the unnecessary memory copies (which will require some non-trivial
changes to TensorIterator).
Test Plan:
```
python test/test_quantization.py TestQuantizedOps.test_advanced_indexing
```
Imported from OSS
Reviewed By: jerryzh168
Differential Revision: D25539365
fbshipit-source-id: 98485875aaaf5743e1a940e170258057691be4fa