| 767 | } |
| 768 | |
| 769 | py::dict get_custom_op_lib_info(void) { |
| 770 | #if MGB_CUSTOM_OP |
| 771 | auto&& libs = custom::CustomOpManager::inst()->lib_info(); |
| 772 | py::dict ret; |
| 773 | for (auto&& [lib_name, lib_handle] : libs) { |
| 774 | py::list ops = py::cast(lib_handle->ops_in_lib()); |
| 775 | ret[py::str(lib_name)] = ops; |
| 776 | } |
| 777 | return ret; |
| 778 | #else |
| 779 | mgb_assert(false, "CustomOp disabled, please build megengine with CustomOp open"); |
| 780 | return py::list{}; |
| 781 | #endif |
| 782 | } |
| 783 | |
| 784 | #ifndef METH_FASTCALL |
| 785 | PyObject* py35_make_custom_op(PyObject* self, PyObject* args) { |