Repository: pytorch
Issue: native_batch_norm has different size results on "CPU" vs "META" device
Labels: triaged,module: meta tensors,module: fakeTensor

### 🐛 Describe the bug

When `native_batch_norm` is run on `CPU` device with `running_mean` and `running_var` of size `[3]`, the last two results have size `[0]`. However, when run on the `META` device, the last two results have size `[3]`.

```python
import torch

input_tensor = torch.rand(2, 3)
running_mean = torch.rand(3)
running_var = torch.rand(3)

result = torch.ops.aten.native_batch_norm(
    input_tensor, weight=None, bias=None, running_mean=running_mean,
    running_var=running_var, training=False, momentum=1e-4, eps=1e-6)
result_meta = torch.ops.aten.native_batch_norm(
    input_tensor.to("meta"), weight=None, bias=None, running_mean=running_mean.to("meta"),
    running_var=running_var.to("meta"), training=False, momentum=1e-4, eps=1e-6)

print(result[1].shape, result[2].shape)           # torch.Size([0]) torch.Size([0])
print(result_meta[1].shape, result_meta[2].shape) # torch.Size([3]) torch.Size([3])
```

### Versions

```
PyTorch version: 2.1.0.dev20230505+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Debian GNU/Linux rodete (x86_64)
GCC version: (Debian 12.2.0-14) 12.2.0
Clang version: 14.0.6
CMake version: version 3.22.5
Libc version: glibc-2.36

Python version: 3.10.9 (main, Dec  7 2022, 13:47:07) [GCC 12.2.0] (64-bit runtime)
Python platform: Linux-6.1.15-1rodete3-amd64-x86_64-with-glibc2.36
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Address sizes:                   46 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          96
On-line CPU(s) list:             0-95
Vendor ID:                       GenuineIntel
Model name:                      Intel(R) Xeon(R) CPU @ 2.00GHz
CPU family:                      6
Model:                           85
Thread(s) per core:              2
Core(s) per socket:              24
Socket(s):                       2
Stepping:                        3
BogoMIPS:                        4000.36
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves arat md_clear arch_capabilities
Virtualization:                  VT-x
Hypervisor vendor:               KVM
Virtualization type:             full
L1d cache:                       1.5 MiB (48 instances)
L1i cache:                       1.5 MiB (48 instances)
L2 cache:                        48 MiB (48 instances)
L3 cache:                        77 MiB (2 instances)
NUMA node(s):                    2
NUMA node0 CPU(s):               0-23,48-71
NUMA node1 CPU(s):               24-47,72-95
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Mitigation; PTE Inversion; VMX flush not necessary, SMT vulnerable
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT Host state unknown
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Mmio stale data:   Vulnerable: Clear CPU buffers attempted, no microcode; SMT Host state unknown
Vulnerability Retbleed:          Mitigation; IBRS
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; Clear CPU buffers; SMT Host state unknown

Versions of relevant libraries:
[pip3] bert-pytorch==0.0.1a4
[pip3] functorch==0.3.0a0+0feda8a
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.23.1
[pip3] pytorch-transformers==1.2.0
[pip3] torch==2.1.0.dev20230505+cpu
[pip3] torch-struct==0.5
[pip3] torchdynamo==1.13.0.dev0
[pip3] torchfile==0.1.0
[pip3] torchmetrics==0.9.2
[pip3] torchrec-nightly==2022.4.26
[pip3] torchvision==0.16.0.dev20230505+cpu
[pip3] torchx-nightly==2022.7.1
[conda] Could not collect
```

cc @ezyang @eellison @bdhirsh @soumith