[ONNX] Fix exporting copy_ with index as tensor input (#32801)
Summary:
Supporting the below case. Previously index for copy_ was only considered as constant integer, where as it could be a tensor input as well.
```python
class InPlaceIndexedAssignment(torch.nn.Module):
def forward(self, data, index, new_data):
data[index] = new_data
return data
data = torch.zeros(3, 4)
index = torch.tensor(1)
new_data = torch.arange(4).to(torch.float32)
torch.onnx.export(InPlaceIndexedAssignment(), (data, index, new_data), 'inplace_assign.onnx', opset_version=11)
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/32801
Reviewed By: hl475
Differential Revision: D19731666
Pulled By: houseroad
fbshipit-source-id: 08703fdccd817f901282e19847e259d93929e702