ONNX exporter issue: fails to add conversions exporting T5 Transformer model
Labels: module: onnx, triaged

### 🐛 Describe the bug

To reproduce, run the following script:

```
import torch

from transformers import AutoTokenizer, T5ForConditionalGeneration

def input_example(self, max_batch=1, max_dim=64, seq_len=16):
    sample = next(self.parameters())
    input_ids = torch.randint(low=0, high=max_dim, size=(max_batch, seq_len), device=sample.device)
    labels = torch.randint(low=0, high=max_dim, size=(max_batch, seq_len), device=sample.device)
    attention_mask = torch.randint(low=0, high=1, size=(max_batch, seq_len), device=sample.device)
    return tuple([input_ids, attention_mask, labels])

model = T5ForConditionalGeneration.from_pretrained("google/byt5-small")

torch.onnx.export(model,
                  input_example(model),
                  "t5.onnx",
                  verbose=True,
                  opset_version=16,
                  do_constant_folding=True,
                  )
                  ```
```                 
python t5_repro.py
```
Observe result:
```
....
/usr/local/lib/python3.10/dist-packages/torch/onnx/utils.py:1655: UserWarning: The exported ONNX model failed ONNX shape inference.The model will not be executable by the ONNX Runt
ime.If this is unintended and you believe there is a bug,please report an issue at https://github.com/pytorch/pytorch/issues.Error reported by strict ONNX shape inference: [ShapeIn
ferenceError] (op_type:Where, node name: /encoder/block.0/layer.0/SelfAttention/Where): Y has inconsistent type tensor(float) (Triggered internally at /opt/pytorch/pytorch/torch/cs
rc/jit/serialization/export.cpp:1410.)
```
Resulting ONNX does fail in ORT if attempted.

Expected behavior

Working ONNX file should be generated.

The problem is that some arguments to transformer functions are coming in as float that should have been long integers. Torch eager and TorchScript are doing implicit conversion on the fly, while ONNX exporter does not add explicit casts, and that code fails later in ORT because ONNX does not have implicit conversion mechanism. 


### Versions

PyTorch version: 2.1.0a0+4136153
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.2 LTS (x86_64)
GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
Clang version: Could not collect
CMake version: version 3.24.1
Libc version: glibc-2.35

Python version: 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] (64-bit runtime)
Python platform: Linux-5.15.0-46-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.1.105
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA RTX A5000
....
Versions of relevant libraries:
[pip3] k2==1.24.3.dev20230725+cuda12.1.torch2.1.0a0
[pip3] numpy==1.22.2
[pip3] pytorch-lightning==1.9.0
[pip3] pytorch-quantization==2.1.2
[pip3] torch==2.1.0a0+4136153
[pip3] torch-cluster==1.6.1
[pip3] torch-geometric==2.3.1
[pip3] torch-sparse==0.6.17
[pip3] torch-spline-conv==1.2.2
[pip3] torch-tensorrt==1.5.0.dev0

> pip show onnxruntime-gpu
Name: onnxruntime-gpu
Version: 1.15.0