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

Method LayerSetUp

include/caffe/layers/python_layer.hpp:19–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected