[PT2.0] empty output shape causes Segmentation fault
Labels: triaged, bug, oncall: pt2, module: aotdispatch, module: inductor

### 🐛 Describe the bug

If output tensor is initialized with torch.empty(0) and then passed through the torch.compile then there is an segfault observed n allocating tensor with invalid size
Use below sample code to reproduce the issue:
```
import torch
def fn(x, y):
    torch.abs(x, out=y)

x = torch.rand((8, 8))
y = torch.empty(0)
compiled_fn = torch.compile(fn)
compiled_fn(x, y)
print(y)
```

### Error logs

```
Internal Error: Received signal - Segmentation fault
dmesg: read kernel buffer failed: Operation not permitted
Fatal Python error: Segmentation fault
Thread 0x00007fa475c0c700 (most recent call first):
  File "/usr/lib/python3.8/concurrent/futures/thread.py", line 78 in _worker
  File "/usr/lib/python3.8/threading.py", line 870 in run
  File "/usr/lib/python3.8/threading.py", line 932 in _bootstrap_inner
  File "/usr/lib/python3.8/threading.py", line 890 in _bootstrap

Thread 0x00007fa47540b700 (most recent call first):
  File "/usr/lib/python3.8/selectors.py", line 415 in select
  File "/usr/lib/python3.8/multiprocessing/connection.py", line 931 in wait
  File "/usr/lib/python3.8/concurrent/futures/process.py", line 362 in _queue_management_worker
  File "/usr/lib/python3.8/threading.py", line 870 in run
  File "/usr/lib/python3.8/threading.py", line 932 in _bootstrap_inner
  File "/usr/lib/python3.8/threading.py", line 890 in _bootstrap

Thread 0x00007fa41ca8d700 (most recent call first):
  File "/usr/lib/python3.8/threading.py", line 306 in wait
  File "/usr/lib/python3.8/threading.py", line 558 in wait
  File "/usr/local/lib/python3.8/dist-packages/tqdm/_monitor.py", line 60 in run
  File "/usr/lib/python3.8/threading.py", line 932 in _bootstrap_inner
  File "/usr/lib/python3.8/threading.py", line 890 in _bootstrap

Current thread 0x00007fa4a6fd5dc0 (most recent call first):
  File "/tmp/torchinductor_root/u4/cu4v5vey6e3iafqgfidpy6wayatqg6bhyuqbkarylgvhc2uvflyj.py", line 49 in call
  File "/usr/local/lib/python3.8/dist-packages/torch/_functorch/aot_autograd.py", line 1247 in call_func_with_args
  File "/usr/local/lib/python3.8/dist-packages/torch/_functorch/aot_autograd.py", line 1898 in runtime_wrapper
  File "/usr/local/lib/python3.8/dist-packages/torch/_functorch/aot_autograd.py", line 1222 in g
  File "/usr/local/lib/python3.8/dist-packages/torch/_functorch/aot_autograd.py", line 2819 in forward
  File "/usr/local/lib/python3.8/dist-packages/torch/_dynamo/eval_frame.py", line 209 in _fn
  File "out_abs.py", line 17 in forward
  File "/usr/local/lib/python3.8/dist-packages/torch/_dynamo/eval_frame.py", line 209 in _fn
  File "/usr/local/lib/python3.8/dist-packages/torch/_dynamo/eval_frame.py", line 82 in forward
  File "/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py", line 1501 in _call_impl
  File "out_abs.py", line 25 in run_on_device
  File "out_abs.py", line 32 in <module>
Segmentation fault (core dumped)

```

### Minified repro

```
import torch
def fn(x, y):
    torch.abs(x, out=y)

x = torch.rand((8, 8))
y = torch.empty(0)
compiled_fn = torch.compile(fn)
compiled_fn(x, y)
print(y)
```

### Versions

Name: torch
Version: 2.0.0
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: packages@pytorch.org
License: BSD-3
Location: /home/jthakur/.pt_2_0/lib/python3.8/site-packages
Requires: filelock, jinja2, networkx, nvidia-cublas-cu11, nvidia-cuda-cupti-cu11, nvidia-cuda-nvrtc-cu11, nvidia-cuda-runtime-cu11, nvidia-cudnn-cu11, nvidia-cufft-cu11, nvidia-curand-cu11, nvidia-cusolver-cu11, nvidia-cusparse-cu11, nvidia-nccl-cu11, nvidia-nvtx-cu11, sympy, triton, typing-extensions
Required-by: torchaudio, torchvision, triton

cc @ezyang @gchanan @zou3519 @soumith @msaroufim @wconstab @ngimel @bdhirsh @voznesenskym @penguinwu @anijain2305 @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire