Repository: pytorch
Issue: `export()` fails for `full((n,), v)` but succeeds for `ones((n,)) * v` where `v` is dynamic
Labels: oncall: pt2,module: dynamic shapes,module: dynamo,oncall: export

### 🐛 Describe the bug

When using `torch.full((n,), v)` to create a tensor with a dynamic value, one receives a `Pending unbacked symbols` error. A simple workaround is to use `torch.ones((n,)) * v`, but unless I'm missing something the former should work just as well.

Below is a minimal example to reproduce the error:

```python
import torch
import torch._dynamo
import torch.export

class FullConstNDynamicV(torch.nn.Module):
    def forward(self, x):
        n = 7
        v = x[0, 0]
        out = torch.full((n,), v)
        # Replacing the above line with the following will fix export 'Pending unbacked symbols' error:
        # out = torch.ones((n,)) * v

        return out

input_tensor = torch.ones(1, 100)
torch.export.export(FullConstNDynamicV(), (input_tensor, ))
```

Note that an example that uses a dynamic value for `n` but non-dynamic `v` does work. I have [a sample notebook available](https://colab.research.google.com/drive/1L5lNvDs94tLj-qPwUzT52IADWY0WacS_?usp=sharing) to review the following cases:

```
OK: OnesConstNDynamicV
Error: FullConstNDynamicV
OK: OnesDynamicNConstV
OK: FullDynamicNConstV
OK: OnesDynamicNDynamicV
Error: FullDynamicNDynamicV
```

Where OK means the corresponding code was export OK, and Error if it produced an error... It is expected that all modules should be export OK.

### Versions

Ran in Google Colab. 

```
PyTorch version: 2.4.1+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: 14.0.0-1ubuntu1.1
CMake version: version 3.30.4
Libc version: glibc-2.35

Python version: 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-6.1.85+-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: 12.2.140
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.6
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.6
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):                               2
On-line CPU(s) list:                  0,1
Vendor ID:                            GenuineIntel
Model name:                           Intel(R) Xeon(R) CPU @ 2.20GHz
CPU family:                           6
Model:                                79
Thread(s) per core:                   2
Core(s) per socket:                   1
Socket(s):                            1
```

cc @ezyang @chauhang @penguinwu @bobrenjc93 @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @amjames @rec @avikchaudhuri @gmagogsfm @zhxchen17 @tugsbayasgalan @angelayi @suo @ydwu4