[pycaffe] expose Net::Reshape
authorJonathan L Long <jonlong@cs.berkeley.edu>
Fri, 12 Sep 2014 22:23:11 +0000 (15:23 -0700)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Thu, 18 Sep 2014 20:17:43 +0000 (13:17 -0700)
python/caffe/_caffe.cpp
python/caffe/_caffe.hpp

index 39e5d09..5a81a42 100644 (file)
@@ -149,6 +149,7 @@ BOOST_PYTHON_MODULE(_caffe) {
       .def(bp::init<string>())
       .def("_forward",              &PyNet::Forward)
       .def("_backward",             &PyNet::Backward)
+      .def("reshape",               &PyNet::Reshape)
       .def("set_mode_cpu",          &PyNet::set_mode_cpu)
       .def("set_mode_gpu",          &PyNet::set_mode_gpu)
       .def("set_phase_train",       &PyNet::set_phase_train)
index 5884900..ba04d27 100644 (file)
@@ -98,6 +98,7 @@ class PyNet {
 
   void Forward(int start, int end) { net_->ForwardFromTo(start, end); }
   void Backward(int start, int end) { net_->BackwardFromTo(start, end); }
+  void Reshape() { net_->Reshape(); }
 
   void set_input_arrays(bp::object data_obj, bp::object labels_obj);