Support ONNX export for aten::select_backward and aten::slice_backward
Labels: module: onnx, triaged, onnx-triaged

### 🚀 The feature, motivation and pitch

I am trying to export the graph to compute the gradient of a function that includes indexing. This fails because of this:

```python
import torch

def f(x):
    return torch.sum(x[:1])

class EvaluateGradient(torch.nn.Module):
    def __init__(self, f):
        super().__init__()
        self.f = f

    def forward(self, x):
        y = self.f(x)
        grads = torch.autograd.grad(y, x, create_graph=True)
        return grads[0]

x = torch.zeros((2, 2))
x.requires_grad_()

print(f(x))

grad = EvaluateGradient(f)

print(grad(x))

torch.onnx.export(grad, x, "model.onnx")
```

results in

```
tensor(0., grad_fn=<SumBackward0>)
```

```
tensor([[1., 1.],
        [0., 0.]])
```

and finally this error when exporting

```
================ Diagnostic Run torch.onnx.export version 2.0.1 ================
verbose: False, log level: Level.ERROR
======================= 0 NONE 0 NOTE 0 WARNING 1 ERROR ========================
ERROR: missing-standard-symbolic-function
=========================================
Exporting the operator 'aten::select_backward' to ONNX opset version 14 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub: https://github.com/pytorch/pytorch/issues.
None
<Set verbose=True to see more details>


Traceback (most recent call last):
  File "/Users/jonas/Desktop/pytorch_select_backward/08_torch_unsupported_op_export_select_backward.py", line 30, in <module>
    torch.onnx.export(grad, x, "model.onnx")
  File "/Users/jonas/Desktop/pytorch_select_backward/venv/lib/python3.11/site-packages/torch/onnx/utils.py", line 506, in export
    _export(
  File "/Users/jonas/Desktop/pytorch_select_backward/venv/lib/python3.11/site-packages/torch/onnx/utils.py", line 1548, in _export
    graph, params_dict, torch_out = _model_to_graph(
                                    ^^^^^^^^^^^^^^^^
  File "/Users/jonas/Desktop/pytorch_select_backward/venv/lib/python3.11/site-packages/torch/onnx/utils.py", line 1117, in _model_to_graph
    graph = _optimize_graph(
            ^^^^^^^^^^^^^^^^
  File "/Users/jonas/Desktop/pytorch_select_backward/venv/lib/python3.11/site-packages/torch/onnx/utils.py", line 665, in _optimize_graph
    graph = _C._jit_pass_onnx(graph, operator_export_type)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jonas/Desktop/pytorch_select_backward/venv/lib/python3.11/site-packages/torch/onnx/utils.py", line 1901, in _run_symbolic_function
    raise errors.UnsupportedOperatorError(
torch.onnx.errors.UnsupportedOperatorError: Exporting the operator 'aten::select_backward' to ONNX opset version 14 is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub: https://github.com/pytorch/pytorch/issues.
```

The same is also true when we replace `[0]` with `[:1]`. The `UnsupportedOperatorError` is then raised for `aten::slice_backward`.

I've tested this with the latest PyTorch version `2.0.1` and for the default `opset_version` `14` as well as `17` (the latest supported version).

### Alternatives

I am not aware of any alternatives / workarounds.

### Additional context

_No response_