| 248 | #ifdef WITH_PYTHON_LAYER |
| 249 | template <typename Dtype> |
| 250 | shared_ptr<Layer<Dtype> > GetPythonLayer(const LayerParameter& param) { |
| 251 | Py_Initialize(); |
| 252 | try { |
| 253 | bp::object module = bp::import(param.python_param().module().c_str()); |
| 254 | bp::object layer = module.attr(param.python_param().layer().c_str())(param); |
| 255 | return bp::extract<shared_ptr<PythonLayer<Dtype> > >(layer)(); |
| 256 | } catch (bp::error_already_set) { |
| 257 | PyErr_Print(); |
| 258 | throw; |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | REGISTER_LAYER_CREATOR(Python, GetPythonLayer); |
| 263 | #endif |
nothing calls this directly
no outgoing calls
no test coverage detected