Skip to content
Snippets Groups Projects
Commit caddb8f4 authored by Cyril Moineau's avatar Cyril Moineau
Browse files

Fix registrar if exists condition for pybind.

parent d00e9a7f
No related branches found
No related tags found
No related merge requests found
......@@ -132,11 +132,13 @@ void declare_registrable(py::module& m, const std::string& class_name){
#ifdef PYBIND
#define SET_IMPL_MACRO(T_Op, op, backend_name) \
\
if(Py_IsInitialized()) { \
auto obj = py::cast(&(op)); \
(op).setImpl(Registrar<T_Op>::create(backend_name)(op)); \
} else { \
(op).setImpl(Registrar<T_Op>::create(backend_name)(op)); \
if (Registrar<T_Op>::exists(backend_name)) { \
if(Py_IsInitialized()) { \
auto obj = py::cast(&(op)); \
(op).setImpl(Registrar<T_Op>::create(backend_name)(op)); \
} else { \
(op).setImpl(Registrar<T_Op>::create(backend_name)(op)); \
} \
}
#else
#define SET_IMPL_MACRO(T_Op, op, backend_name) \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment