Skip to content

Commit

Permalink
Merge pull request BVLC#5455 from cypof/remove_shared_parallel
Browse files Browse the repository at this point in the history
Remove missed legacy parallel code
  • Loading branch information
cypof authored Apr 12, 2017
2 parents 88b10af + 850ffd8 commit 90eff9b
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 19 deletions.
2 changes: 0 additions & 2 deletions include/caffe/layers/base_data_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ class BaseDataLayer : public Layer<Dtype> {
// This method may not be overridden except by the BasePrefetchingDataLayer.
virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
// Data layers should be shared by multiple solvers in parallel
virtual inline bool ShareInParallel() const { return true; }
virtual void DataLayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {}
// Data layers have no bottoms, so reshaping is trivial.
Expand Down
2 changes: 0 additions & 2 deletions include/caffe/layers/data_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class DataLayer : public BasePrefetchingDataLayer<Dtype> {
virtual ~DataLayer();
virtual void DataLayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
// DataLayer uses DataReader instead for sharing for parallelism
virtual inline bool ShareInParallel() const { return false; }
virtual inline const char* type() const { return "Data"; }
virtual inline int ExactNumBottomBlobs() const { return 0; }
virtual inline int MinTopBlobs() const { return 1; }
Expand Down
2 changes: 0 additions & 2 deletions include/caffe/layers/dummy_data_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class DummyDataLayer : public Layer<Dtype> {
: Layer<Dtype>(param) {}
virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
// Data layers should be shared by multiple solvers in parallel
virtual inline bool ShareInParallel() const { return true; }
// Data layers have no bottoms, so reshaping is trivial.
virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {}
Expand Down
2 changes: 0 additions & 2 deletions include/caffe/layers/hdf5_data_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ class HDF5DataLayer : public Layer<Dtype> {
virtual ~HDF5DataLayer();
virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
// Data layers should be shared by multiple solvers in parallel
virtual inline bool ShareInParallel() const { return true; }
// Data layers have no bottoms, so reshaping is trivial.
virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {}
Expand Down
2 changes: 0 additions & 2 deletions include/caffe/layers/hdf5_output_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class HDF5OutputLayer : public Layer<Dtype> {
virtual ~HDF5OutputLayer();
virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
// Data layers should be shared by multiple solvers in parallel
virtual inline bool ShareInParallel() const { return true; }
// Data layers have no bottoms, so reshaping is trivial.
virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {}
Expand Down
2 changes: 0 additions & 2 deletions include/caffe/layers/input_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class InputLayer : public Layer<Dtype> {
: Layer<Dtype>(param) {}
virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
// Data layers should be shared by multiple solvers in parallel
virtual inline bool ShareInParallel() const { return true; }
// Data layers have no bottoms, so reshaping is trivial.
virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top) {}
Expand Down
4 changes: 0 additions & 4 deletions include/caffe/layers/python_layer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ class PythonLayer : public Layer<Dtype> {
self_.attr("reshape")(bottom, top);
}

virtual inline bool ShareInParallel() const {
return this->layer_param_.python_param().share_in_parallel();
}

virtual inline const char* type() const { return "Python"; }

protected:
Expand Down
4 changes: 1 addition & 3 deletions src/caffe/proto/caffe.proto
Original file line number Diff line number Diff line change
Expand Up @@ -937,9 +937,7 @@ message PythonParameter {
// string, dictionary in Python dict format, JSON, etc. You may parse this
// string in `setup` method and use it in `forward` and `backward`.
optional string param_str = 3 [default = ''];
// Whether this PythonLayer is shared among worker solvers during data parallelism.
// If true, each worker solver sequentially run forward from this layer.
// This value should be set true if you are using it as a data layer.
// DEPRECATED
optional bool share_in_parallel = 4 [default = false];
}

Expand Down

0 comments on commit 90eff9b

Please sign in to comment.