MCPcopy Create free account
hub / github.com/BVLC/caffe / GetPythonLayer

Function GetPythonLayer

src/caffe/layer_factory.cpp:250–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248#ifdef WITH_PYTHON_LAYER
249template <typename Dtype>
250shared_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
262REGISTER_LAYER_CREATOR(Python, GetPythonLayer);
263#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected