Repository: pytorch
Issue: torch.fx.symbolic_trace fails on torch.arange with input-dependent size
Labels: triaged,module: fx

## 🐛 Bug

I'm trying to use torch.fx.symbolic_trace to trace an `arange` call where the first argument to `arange` is part of the size of the input tensor:
```
l = x.size(1)
torch.arange(l, dtype=torch.long, device='cuda')
```
And it fails.

## To Reproduce

```
import torch
from torch.fx import symbolic_trace
def test(x):
    l = x.size(1)
    return torch.arange(l, dtype=torch.long, device='cuda')
traced = symbolic_trace(test)
```
Trace:
```
Traceback (most recent call last):
  File "repro.py", line 6, in <module>
    traced = symbolic_trace(test)
  File "/opt/pytorch/pytorch/torch/fx/symbolic_trace.py", line 606, in symbolic_trace
    graph = tracer.trace(root, concrete_args)
  File "/opt/pytorch/pytorch/torch/fx/symbolic_trace.py", line 355, in trace
    self.create_node('output', 'output', (self.create_arg(fn(*args)),), {},
  File "repro.py", line 5, in test
    return torch.arange(l, dtype=torch.long, device='cuda')
TypeError: arange() received an invalid combination of arguments - got (Proxy, device=str, dtype=torch.dtype), but expected one of:
 * (Number end, *, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
 * (Number start, Number end, Number step, *, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
 *
```

## Expected behavior

Method is successfully traced

## Environment

```
Collecting environment information...
PyTorch version: 1.8.0a0+28c5d90
Is debug build: False
CUDA used to build PyTorch: 11.2
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.1 LTS (x86_64)
GCC version: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
Clang version: Could not collect
CMake version: version 3.19.4

Python version: 3.8 (64-bit runtime)
Is CUDA available: True
CUDA runtime version: Could not collect
GPU models and configuration:
$GPUs
Nvidia driver version: 455.34
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.1.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.1.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.1.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.1.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.1.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.1.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.1.0
HIP runtime version: N/A
MIOpen runtime version: N/A

Versions of relevant libraries:
[pip3] numpy==1.19.2
[pip3] torch==1.8.0a0+28c5d90
[pip3] torchvision==0.9.0a0+ced96a0
[conda] magma-cuda110             2.5.2                         1    pytorch
[conda] mkl                       2019.1                      144
[conda] mkl-include               2019.1                      144
[conda] nomkl                     3.0                           0
[conda] numpy                     1.19.2           py38h6163131_0
[conda] numpy-base                1.19.2           py38h75fe3a5_0
[conda] torch                     1.8.0a0+28c5d90           dev_0    <develop>
[conda] torchvision               0.9.0a0+ced96a0          pypi_0    pypi
```



cc @ezyang @SherlockNoMad