| 17 | : Layer<Dtype>(param), self_(bp::handle<>(bp::borrowed(self))) { } |
| 18 | |
| 19 | virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom, |
| 20 | const vector<Blob<Dtype>*>& top) { |
| 21 | // Disallow PythonLayer in MultiGPU training stage, due to GIL issues |
| 22 | // Details: https://github.com/BVLC/caffe/issues/2936 |
| 23 | if (this->phase_ == TRAIN && Caffe::solver_count() > 1 |
| 24 | && !Caffe::multiprocess()) { |
| 25 | LOG(FATAL) << "PythonLayer does not support CLI Multi-GPU, use train.py"; |
| 26 | } |
| 27 | self_.attr("param_str") = bp::str( |
| 28 | this->layer_param_.python_param().param_str()); |
| 29 | self_.attr("phase") = static_cast<int>(this->phase_); |
| 30 | self_.attr("setup")(bottom, top); |
| 31 | } |
| 32 | virtual void Reshape(const vector<Blob<Dtype>*>& bottom, |
| 33 | const vector<Blob<Dtype>*>& top) { |
| 34 | self_.attr("reshape")(bottom, top); |
nothing calls this directly
no outgoing calls
no test coverage detected