pytorch/torch/csrc/stub.cpp
#include <Python.h>
#ifdef _WIN32
__declspec(dllimport)
#endif
extern PyObject* initModule();
#if PY_MAJOR_VERSION == 2
PyMODINIT_FUNC init_C()
{
initModule();
}
#else
PyMODINIT_FUNC PyInit__C()
{
return initModule();
}
#endif
pytorch/torch/csrc/Module.cpp
Partly torch._C
module = Py_InitModule("torch._C", methods.data());