onnx export fails when using torchvision.transforms.CenterCrop
Labels: module: onnx, triaged, onnx-triaged

### 🐛 Describe the bug

During onnx export calls to torch.Tensor.size() return tensors as opposed to integers. This causes the CenterCrop to fail because it cannot call the round function on these tensors. Example to reproduce the error:

```python
import torch
import torchvision.transforms as T
from torch import nn


class CropNet(nn.Module):
    def __init__(self):
        super().__init__()
        self.name = "CropNet"

    def forward(self, x):
        _, _, sx, sy = x.size()
        x = T.CenterCrop((sx // 2, sy // 2))(x)
        return x

    def save_onnx(self, path, verbose):
        dummy_input = torch.randn(8, 1, 64, 64)
        torch.onnx.export(self, dummy_input, path, verbose=verbose,
                          input_names=["input"],
                          output_names=["output"],
                          dynamic_axes={
                              "input": {0: "batch"},
                              "output": {0: "batch"}
                          },
                          )


if __name__ == "__main__":
    net = CropNet()
    cropped = net.forward(torch.randn(8, 1, 64, 64))  # normal execution works
    net.save_onnx("cropnet.onnx", False)  # export gives error message
```
Execution of the last line produces the following error message:
```
Traceback (most recent call last):
  File "/tmp/example.py", line 31, in <module>
    net.save_onnx("cropnet.onnx", False)  # export gives error message
  File "/tmp/example.py", line 18, in save_onnx
    torch.onnx.export(self, dummy_input, path, verbose=verbose,
  File "/home/simon/.local/lib/python3.10/site-packages/torch/onnx/__init__.py", line 305, in export
    return utils.export(model, args, f, export_params, verbose, training,
  File "/home/simon/.local/lib/python3.10/site-packages/torch/onnx/utils.py", line 118, in export
    _export(model, args, f, export_params, verbose, training, input_names, output_names,
  File "/home/simon/.local/lib/python3.10/site-packages/torch/onnx/utils.py", line 719, in _export
    _model_to_graph(model, args, verbose, input_names,
  File "/home/simon/.local/lib/python3.10/site-packages/torch/onnx/utils.py", line 499, in _model_to_graph
    graph, params, torch_out, module = _create_jit_graph(model, args)
  File "/home/simon/.local/lib/python3.10/site-packages/torch/onnx/utils.py", line 440, in _create_jit_graph
    graph, torch_out = _trace_and_get_graph_from_model(model, args)
  File "/home/simon/.local/lib/python3.10/site-packages/torch/onnx/utils.py", line 391, in _trace_and_get_graph_from_model
    torch.jit._get_trace_graph(model, args, strict=False, _force_outplace=False, _return_inputs_states=True)
  File "/home/simon/.local/lib/python3.10/site-packages/torch/jit/_trace.py", line 1166, in _get_trace_graph
    outs = ONNXTracedModule(f, strict, _force_outplace, return_inputs, _return_inputs_states)(*args, **kwargs)
  File "/home/simon/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/simon/.local/lib/python3.10/site-packages/torch/jit/_trace.py", line 127, in forward
    graph, out = torch._C._create_graph_by_tracing(
  File "/home/simon/.local/lib/python3.10/site-packages/torch/jit/_trace.py", line 118, in wrapper
    outs.append(self.inner(*trace_inputs))
  File "/home/simon/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/simon/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1098, in _slow_forward
    result = self.forward(*input, **kwargs)
  File "/tmp/example.py", line 13, in forward
    x = T.CenterCrop((sx // 2, sy // 2))(x)
  File "/home/simon/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
    return forward_call(*input, **kwargs)
  File "/home/simon/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1098, in _slow_forward
    result = self.forward(*input, **kwargs)
  File "/home/simon/.local/lib/python3.10/site-packages/torchvision/transforms/transforms.py", line 381, in forward
    return F.center_crop(img, self.size)
  File "/home/simon/.local/lib/python3.10/site-packages/torchvision/transforms/functional.py", line 551, in center_crop
    crop_top = int(round((image_height - crop_height) / 2.0))
TypeError: type Tensor doesn't define __round__ method
```

### Versions

Collecting environment information...
PyTorch version: 1.11.0+cu102
Is debug build: False
CUDA used to build PyTorch: 10.2
ROCM used to build PyTorch: N/A

OS: Manjaro Linux (x86_64)
GCC version: (GCC) 11.2.0
Clang version: 13.0.1
CMake version: version 3.23.0
Libc version: glibc-2.35

Python version: 3.10.4 (main, Mar 23 2022, 23:05:40) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-5.10.109-1-MANJARO-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2060 SUPER
Nvidia driver version: 510.60.02
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] numpy==1.21.4
[pip3] torch==1.11.0
[pip3] torchvision==0.12.0
[conda] Could not collect