pytorch/torch/jit
Ailing Zhang dd618216c5 [JIT]Support adv indexing using list. (#37848)
Summary:
We used to only support indexing through
- numbers like `x[0, 1]`
- tuple like `x[(0, 1)]`
- tensor like `x[torch.tensor([0, 1])]`

This PR adds support for indexing through list which is equivalent to tensor.
- `x[[0, 1, 5]]`
- `x[[0, 1], [0, 1]]`
- `x[[[0, 1], [0, 1]], [[0, 1], [0, 1]]]`

Note for `x[[0, 1, 5]]` we had a bug in AST conversion code so we used to treat it like `x[0, 1, 5]` which means it might accidentally run and produce wrong result(fixes https://github.com/pytorch/pytorch/issues/37286 fixes https://github.com/pytorch/pytorch/issues/18616), now that it's fixed we probably want to mark it as BC breaking.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37848

Reviewed By: suo

Differential Revision: D21409840

Pulled By: ailzhang

fbshipit-source-id: 6f2d962885c6dc009cb384d98be1822f5ca7a189
2020-05-06 10:44:48 -07:00
..
__init__.py [jit] fix trace checking reporting divergent names (#37842) 2020-05-05 13:39:41 -07:00
_builtins.py Add Inverse Short Time Fourier Transform in ATen native (#35569) 2020-04-24 12:14:55 -07:00
_logging.py Experimental logging/counters API (#18235) 2019-03-29 17:14:03 -07:00
_pickle.py [jit] Add type tags to lists/dicts in pickle (#33255) 2020-03-10 19:17:01 -07:00
_recursive.py [jit] Fix bound method copying (#36546) 2020-04-15 17:38:20 -07:00
annotations.py Remove (most) Python 2 support from Python code (#35615) 2020-04-22 09:23:14 -07:00
frontend.py [JIT]Support adv indexing using list. (#37848) 2020-05-06 10:44:48 -07:00
quantized.py [WIP] Bind in CellParams for RNN (#35787) 2020-04-28 21:47:06 -07:00
supported_ops.py [jit] do the code reorg (#33851) 2020-02-27 13:02:51 -08:00
unsupported_tensor_ops.py Revert "Revert D21337640: [pytorch][PR] Split up documentation into subpages and clean up some warnings" (#37778) 2020-05-04 14:32:35 -07:00