[ONNX] Slightly improve indexing with ellipsis under scripting (#46571)
Summary:
Still depending on rank of original tensor being known. i.e.
```python
x[i, j, k] = y # rank of x must be known at export time
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/46571
Reviewed By: mrshenli
Differential Revision: D24657502
Pulled By: bzinodev
fbshipit-source-id: 6ec87edb67be06e34526225e701954fcfc5606c8