Allow the python layer have attribute "phase"
authorZhouYzzz <zhouyz9608@gmail.com>
Fri, 15 Apr 2016 14:51:49 +0000 (22:51 +0800)
committerZhouYzzz <zhouyz9608@gmail.com>
Fri, 15 Apr 2016 14:51:49 +0000 (22:51 +0800)
include/caffe/layers/python_layer.hpp

index b839d52..66dbbdf 100644 (file)
@@ -26,6 +26,7 @@ class PythonLayer : public Layer<Dtype> {
     }
     self_.attr("param_str") = bp::str(
         this->layer_param_.python_param().param_str());
+    self_.attr("phase") = static_cast<int>(this->phase_);
     self_.attr("setup")(bottom, top);
   }
   virtual void Reshape(const vector<Blob<Dtype>*>& bottom,