MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / init_custom

Function init_custom

imperative/python/src/ops.cpp:792–814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

790#endif
791
792void init_custom(pybind11::module m) {
793 m.def("_install", &install_custom);
794 m.def("_uninstall", &uninstall_custom);
795 m.def("_get_custom_op_list", &get_custom_op_list);
796 m.def("_get_custom_op_lib_info", &get_custom_op_lib_info);
797 m.def("get_custom_op_abi_tag", [](void) -> int {
798 int ret = 0;
799#ifdef _GLIBCXX_USE_CXX11_ABI
800 ret = _GLIBCXX_USE_CXX11_ABI;
801#endif
802 return ret;
803 });
804
805 static PyMethodDef method_def = {
806#ifdef METH_FASTCALL
807 "_make_custom_op", (PyCFunction)make_custom_op, METH_FASTCALL, ""
808#else
809 "_make_custom_op", (PyCFunction)py35_make_custom_op, METH_VARARGS, ""
810#endif
811 };
812 auto* func = PyCFunction_NewEx(&method_def, nullptr, nullptr);
813 pybind11::setattr(m, method_def.ml_name, func);
814}

Callers 1

init_opsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected