detectron2_fcos_r_50_fpn shape error with inductor
Labels: triaged, oncall: pt2, module: dynamic shapes, module: inductor

### 🐛 Describe the bug

```bash
+ python torchbench.py --performance --float32 -dcpu --output=/workspace/pytorch/benchmarks/dynamo/benchmark_logs/inductor_torchbench_float32_inference_cpu_performance.csv -n50 --inductor --no-skip --dashboard -x detectron2_fasterrcnn_r_50_fpn -x detectron2_fasterrcnn_r_50_dc5 -x detectron2_maskrcnn_r_101_c4 -x timm_efficientdet -x detectron2_fasterrcnn_r_101_c4 -x pyhpc_equation_of_state -x detectron2_fasterrcnn_r_50_c4 -x detectron2_maskrcnn -x detectron2_maskrcnn_r_101_fpn -x opacus_cifar10 -x pyhpc_isoneutral_mixing -x maml -x pyhpc_turbulent_kinetic_energy -x detectron2_fasterrcnn_r_101_dc5 -x detectron2_fasterrcnn_r_101_fpn -x fambench_xlmr -x detectron2_maskrcnn_r_50_fpn -k 'resnet..$' --cold-start-latency --only=detectron2_fcos_r_50_fpn
cpu  eval  detectron2_fcos_r_50_fpn            ERROR:common:Backend dynamo failed in warmup()
Traceback (most recent call last):
  File "/workspace/pytorch/benchmarks/dynamo/common.py", line 1375, in warmup
    fn(model, example_inputs)
  File "/home/dy_new/lib/python3.8/site-packages/torch/_dynamo/eval_frame.py", line 209, in _fn
    return fn(*args, **kwargs)
  File "torchbench.py", line 363, in forward_pass
    return mod(*inputs)
  File "/home/dy_new/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/dy_new/lib/python3.8/site-packages/detectron2/modeling/meta_arch/dense_detector.py", line 92, in forward
    images = self.preprocess_image(batched_inputs)
  File "/home/dy_new/lib/python3.8/site-packages/detectron2/modeling/meta_arch/dense_detector.py", line 93, in <graph break in forward>
    features = self.backbone(images.tensor)
  File "/home/dy_new/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/dy_new/lib/python3.8/site-packages/detectron2/modeling/backbone/fpn.py", line 126, in forward
    bottom_up_features = self.bottom_up(x)
  File "/home/dy_new/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/dy_new/lib/python3.8/site-packages/detectron2/modeling/backbone/resnet.py", line 443, in forward
    assert x.dim() == 4, f"ResNet takes an input of shape (N, C, H, W). Got {x.shape} instead!"
  File "/home/dy_new/lib/python3.8/site-packages/detectron2/modeling/backbone/resnet.py", line 443, in <graph break in forward>
    assert x.dim() == 4, f"ResNet takes an input of shape (N, C, H, W). Got {x.shape} instead!"
AssertionError: ResNet takes an input of shape (N, C, H, W). Got (1, 1, 1, 3, 800, 1216) instead!
```

### Versions

DynamoBenchmark(PyTorch): 6c43e9fdbd76ebaa0ae85351bc39116eb7b45ad4
TorchBench: 4a1df233ec934b17318c37be8634161ae312d799

```
Collecting environment information...
PyTorch version: 2.0.0+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.5 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.22.3
Libc version: glibc-2.31

Python version: 3.8.10 (default, Mar 13 2023, 10:26:41)  [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.10.9-051009-generic-x86_64-with-glibc2.29
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
Byte Order:                      Little Endian
Address sizes:                   43 bits physical, 48 bits virtual
CPU(s):                          16
On-line CPU(s) list:             0-15
Thread(s) per core:              2
Core(s) per socket:              8
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       AuthenticAMD
CPU family:                      23
Model:                           49
Model name:                      AMD EPYC 7262 8-Core Processor
Stepping:                        0
Frequency boost:                 enabled
CPU MHz:                         1793.895
CPU max MHz:                     3200.0000
CPU min MHz:                     1500.0000
BogoMIPS:                        6387.66
Virtualization:                  AMD-V
L1d cache:                       256 KiB
L1i cache:                       256 KiB
L2 cache:                        4 MiB
L3 cache:                        128 MiB
NUMA node0 CPU(s):               0-15
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full AMD retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate sme ssbd mba sev ibrs ibpb stibp vmmcall sev_es fsgsbase bmi1 avx2 smep bmi2 cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif umip rdpid overflow_recov succor smca

Versions of relevant libraries:
[pip3] bert-pytorch==0.0.1a4
[pip3] clip-anytorch==2.5.2
[pip3] CoCa-pytorch==0.0.7
[pip3] dalle2-pytorch==1.12.4
[pip3] ema-pytorch==0.2.3
[pip3] functorch==1.14.0a0+b71aa0b
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.21.2
[pip3] open-clip-torch==2.17.2
[pip3] pytorch-transformers==1.2.0
[pip3] pytorch-warmup==0.1.1
[pip3] rotary-embedding-torch==0.2.1
[pip3] torch==2.0.0+cpu
[pip3] torch-fidelity==0.3.0
[pip3] torch-struct==0.5
[pip3] torchaudio==2.0.1+cpu
[pip3] torchdata==0.6.0
[pip3] torchmetrics==0.11.4
[pip3] torchrec-nightly==2023.4.26
[pip3] torchtext==0.15.1+cpu
[pip3] torchvision==0.15.1+cpu
[pip3] vector-quantize-pytorch==1.2.2
[conda] No relevant packages
```

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