Fix fx patch module name (#61062)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61062
Instead of being 'patch' this should be the import-able name of the module (it's defined as `_fx` on the `torch._C` module, so the full name should be `torch._C._fx`). This now works correctly:
```python
>>> import torch._C._fx
>>> dir(torch._C._fx)
['__doc__', '__loader__', '__name__', '__package__', '__spec__', 'patch_function']
```
Test Plan: Imported from OSS
Reviewed By: Chillee
Differential Revision: D29497018
Pulled By: driazati
fbshipit-source-id: 093aa0552b48feb0aabe47bdf72776dddd5a3b8f
diff --git a/torch/csrc/fx/fx_init.cpp b/torch/csrc/fx/fx_init.cpp
index 3467691..f7a1eb2 100644
--- a/torch/csrc/fx/fx_init.cpp
+++ b/torch/csrc/fx/fx_init.cpp
@@ -125,7 +125,7 @@
static struct PyModuleDef path = {
PyModuleDef_HEAD_INIT,
- "patch", /* name of module */
+ "torch._C._fx", /* name of module */
"", /* module documentation, may be NULL */
-1, /* size of per-interpreter state of the module, or -1 if the module
keeps state in global variables. */