Skip to content

Commit

Permalink
Update patches.
Browse files Browse the repository at this point in the history
  • Loading branch information
solrex committed Feb 6, 2017
1 parent 7da3aa0 commit 17c7a60
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 319 deletions.
19 changes: 4 additions & 15 deletions patch/include/caffe/layers/base_data_layer.hpp.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- caffe/include/caffe/layers/base_data_layer.hpp 2017-01-27 09:51:55.386123700 +0800
+++ ../include/caffe/layers/base_data_layer.hpp 2017-02-04 22:35:34.594153197 +0800
+++ ../include/caffe/layers/base_data_layer.hpp 2017-02-06 20:20:48.220476426 +0800
@@ -5,7 +5,9 @@

#include "caffe/blob.hpp"
Expand All @@ -10,30 +10,19 @@
#include "caffe/layer.hpp"
#include "caffe/proto/caffe.pb.h"
#include "caffe/util/blocking_queue.hpp"
@@ -40,8 +42,10 @@
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom) {}

protected:
+#ifdef NO_CAFFE_MOBILE
TransformationParameter transform_param_;
shared_ptr<DataTransformer<Dtype> > data_transformer_;
+#endif
bool output_labels_;
};

@@ -51,6 +55,7 @@
@@ -51,6 +53,7 @@
Blob<Dtype> data_, label_;
};

+#ifdef NO_CAFFE_MOBILE
template <typename Dtype>
class BasePrefetchingDataLayer :
public BaseDataLayer<Dtype>, public InternalThread {
@@ -78,6 +83,7 @@
@@ -78,6 +81,7 @@

Blob<Dtype> transformed_data_;
};
+#endif
+#endif // NO_CAFFE_MOBILE

} // namespace caffe

32 changes: 5 additions & 27 deletions patch/src/caffe/layers/base_data_layer.cpp.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--- caffe/src/caffe/layers/base_data_layer.cpp 2017-01-27 09:51:56.330123800 +0800
+++ ../src/caffe/layers/base_data_layer.cpp 2017-02-04 22:35:34.654099433 +0800
+++ ../src/caffe/layers/base_data_layer.cpp 2017-02-06 20:20:48.228476426 +0800
@@ -1,9 +1,13 @@
+#ifdef USE_BOOST
#include <boost/thread.hpp>
Expand All @@ -14,45 +14,23 @@
#include "caffe/layer.hpp"
#include "caffe/layers/base_data_layer.hpp"
#include "caffe/proto/caffe.pb.h"
@@ -13,8 +17,12 @@

template <typename Dtype>
BaseDataLayer<Dtype>::BaseDataLayer(const LayerParameter& param)
+#ifdef NO_CAFFE_MOBILE
: Layer<Dtype>(param),
transform_param_(param.transform_param()) {
+#else
+ : Layer<Dtype>(param) {
+#endif
}

template <typename Dtype>
@@ -25,13 +33,16 @@
} else {
output_labels_ = true;
}
+#ifdef NO_CAFFE_MOBILE
data_transformer_.reset(
new DataTransformer<Dtype>(transform_param_, this->phase_));
data_transformer_->InitRand();
+#endif
// The subclasses should setup the size of bottom and top
@@ -32,6 +36,7 @@
DataLayerSetUp(bottom, top);
}

+#ifdef NO_CAFFE_MOBILE
template <typename Dtype>
BasePrefetchingDataLayer<Dtype>::BasePrefetchingDataLayer(
const LayerParameter& param)
@@ -129,8 +140,11 @@
@@ -129,8 +134,11 @@
#ifdef CPU_ONLY
STUB_GPU_FORWARD(BasePrefetchingDataLayer, Forward);
#endif
+#endif
+#endif // NO_CAFFE_MOBILE

INSTANTIATE_CLASS(BaseDataLayer);
+#ifdef NO_CAFFE_MOBILE
INSTANTIATE_CLASS(BasePrefetchingDataLayer);
+#endif
+#endif // NO_CAFFE_MOBILE

} // namespace caffe
27 changes: 0 additions & 27 deletions patch/src/caffe/layers/memory_data_layer.cpp.patch

This file was deleted.

Loading

0 comments on commit 17c7a60

Please sign in to comment.