Implement indexing methods for sparse tensors (#24937)
Summary:
Resolves https://github.com/pytorch/pytorch/issues/7416 .
This PR implements the following indexing methods for sparse tensors:
- [x] `select`
- [x] `index_select`
Note that this PR also modifies [gen.py](https://github.com/pytorch/pytorch/pull/24937/files#diff-76aa8cb3d0fad99c5f761d08cbcb4d19) that is not directly required to resolve the original issue but to work around a CI build issue reported in issue https://github.com/pytorch/pytorch/issues/24931 .
Pull Request resolved: https://github.com/pytorch/pytorch/pull/24937
Differential Revision: D17163796
Pulled By: ezyang
fbshipit-source-id: 06613301ec456d9ed3491b9ce48e804048600f09