1 namespace torch {
namespace nn {
3 static PyTypeObject thnn_type;
5 void init_$short_name(PyObject* c_module) {
6 ((PyObject*)&thnn_type)->ob_refcnt = 1;
7 thnn_type.tp_flags = Py_TPFLAGS_DEFAULT;
8 thnn_type.tp_methods = module_methods;
9 thnn_type.tp_name =
"torch._C.$short_name";
10 if (PyType_Ready(&thnn_type) < 0) {
14 PyObject* type_obj = (PyObject*)&thnn_type;
16 if (PyModule_AddObject(c_module,
"$short_name", type_obj) < 0) {