pycaffe: blobs and params are properties, not methods
authorJonathan L Long <jonlong@cs.berkeley.edu>
Sat, 1 Mar 2014 09:48:06 +0000 (01:48 -0800)
committerJonathan L Long <jonlong@cs.berkeley.edu>
Thu, 13 Mar 2014 18:15:57 +0000 (11:15 -0700)
python/caffe/pycaffe.cpp

index 581c7a7..ae0cdf0 100644 (file)
@@ -266,8 +266,9 @@ BOOST_PYTHON_MODULE(pycaffe) {
       .def("set_phase_train",  &CaffeNet::set_phase_train)
       .def("set_phase_test",   &CaffeNet::set_phase_test)
       .def("set_device",       &CaffeNet::set_device)
-      .def("blobs",            &CaffeNet::blobs)
-      .def("params",           &CaffeNet::params);
+      .add_property("blobs",   &CaffeNet::blobs)
+      .add_property("params",  &CaffeNet::params)
+  ;
 
   boost::python::class_<CaffeBlob, CaffeBlobWrap>(
       "CaffeBlob", boost::python::no_init)