Torch Dynamo allow_in_graph doesn't capture the custom function in graph
Labels: triaged, oncall: pt2

### 🐛 Describe the bug

I tried running the following example to try out the torch dynamo allow_in_graph option, expecting a graph that contains 'my_custom_function' instead of torch.add operator, however, the graph returned by `make_fx` resolves to torch operator as shown in (2)

1. Example run:

```python

def my_custom_function(x):
    return x + 1

def test_allow_in_graph():
    torch._dynamo.allow_in_graph(my_custom_function)
    @torch._dynamo.optimize("aot_eager")
    def fn(a):
        x = torch.add(a, 1)
        x = torch.add(x, 1)
        x = my_custom_function(x)
        x = torch.add(x, 1)
        x = torch.add(x, 1)
        return x

    fn(torch.randn(10))
```

2. Graph obtained from pdb session contains the torch operator instead of my_custom_function

```
-> return t
(Pdb) p t.print_readable()
class <lambda>(torch.nn.Module):
    def forward(self, arg0_1: f32[10]):

        add: f32[10] = torch.ops.aten.add.Tensor(arg0_1, 1);  arg0_1 = None
        
        add_1: f32[10] = torch.ops.aten.add.Tensor(add, 1);  add = None
        
        add_2: f32[10] = torch.ops.aten.add.Tensor(add_1, 1);  add_1 = None
        
        add_3: f32[10] = torch.ops.aten.add.Tensor(add_2, 1);  add_2 = None
        
        add_4: f32[10] = torch.ops.aten.add.Tensor(add_3, 1);  add_3 = None
        return (add_4,)
        
'class <lambda>(torch.nn.Module):\n    def forward(self, arg0_1: f32[10]):\n               
add: f32[10] = torch.ops.aten.add.Tensor(arg0_1, 1);  arg0_1 = None\n        \n                
add_1: f32[10] = torch.ops.aten.add.Tensor(add, 1);  add = None\n        \n               
add_2: f32[10] = torch.ops.aten.add.Tensor(add_1, 1);  add_1 = None\n        \n               
add_3: f32[10] = torch.ops.aten.add.Tensor(add_2, 1);  add_2 = None\n        \n                
add_4: f32[10] = torch.ops.aten.add.Tensor(add_3, 1);  add_3 = None\n        
return (add_4,)\n        '


### Versions

python collect_env.py
Collecting environment information...
PyTorch version: 2.1.0.dev20230310+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.4 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.25.1
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.15.0-53-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:                   46 bits physical, 48 bits virtual
CPU(s):                          12
On-line CPU(s) list:             0-11
Thread(s) per core:              2
Core(s) per socket:              6
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           85
Model name:                      Intel(R) Xeon(R) W-2235 CPU @ 3.80GHz
Stepping:                        7
CPU MHz:                         3800.000
CPU max MHz:                     4600.0000
CPU min MHz:                     1200.0000
BogoMIPS:                        7599.80
Virtualization:                  VT-x
L1d cache:                       192 KiB
L1i cache:                       192 KiB
L2 cache:                        6 MiB
L3 cache:                        8.3 MiB
NUMA node0 CPU(s):               0-11
Vulnerability Itlb multihit:     KVM: Mitigation: VMX disabled
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Mmio stale data:   Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed:          Mitigation; Enhanced IBRS
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; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; TSX disabled
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req avx512_vnni md_clear flush_l1d arch_capabilities

Versions of relevant libraries:
[pip3] numpy==1.24.2
[pip3] torch==2.1.0.dev20230310+cpu
[pip3] torchvision==0.15.0.dev20230310+cpu
[conda] Could not collect

cc @ezyang @soumith @msaroufim @wconstab @ngimel @bdhirsh