summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJeff Donahue <jeff.donahue@gmail.com>2014-12-31 14:07:00 -0800
committerJeff Donahue <jeff.donahue@gmail.com>2015-08-25 17:58:45 -0700
commit251e67ab3141bc8ac2adf97ea4e961e5664ae008 (patch)
treed4d6b56f4be4ec1b4f305807a94c2b457e59d49d /include
parent80579b8aa657dc15fd2164e97f103ce364ea77bd (diff)
downloadcaffeonacl-251e67ab3141bc8ac2adf97ea4e961e5664ae008.tar.gz
caffeonacl-251e67ab3141bc8ac2adf97ea4e961e5664ae008.tar.bz2
caffeonacl-251e67ab3141bc8ac2adf97ea4e961e5664ae008.zip
Add TileLayer
Diffstat (limited to 'include')
-rw-r--r--include/caffe/common_layers.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/caffe/common_layers.hpp b/include/caffe/common_layers.hpp
index 691e755f..8e64b3e5 100644
--- a/include/caffe/common_layers.hpp
+++ b/include/caffe/common_layers.hpp
@@ -644,6 +644,35 @@ class SliceLayer : public Layer<Dtype> {
vector<int> slice_point_;
};
+/**
+ * @brief Copy a Blob along specified dimensions.
+ */
+template <typename Dtype>
+class TileLayer : public Layer<Dtype> {
+ public:
+ explicit TileLayer(const LayerParameter& param)
+ : Layer<Dtype>(param) {}
+ virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
+ const vector<Blob<Dtype>*>& top);
+
+ virtual inline const char* type() const { return "Tile"; }
+ virtual inline int ExactNumBottomBlobs() const { return 1; }
+ virtual inline int ExactNumTopBlobs() const { return 1; }
+
+ protected:
+ virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
+ const vector<Blob<Dtype>*>& top);
+ virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom,
+ const vector<Blob<Dtype>*>& top);
+
+ virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
+ const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
+ virtual void Backward_gpu(const vector<Blob<Dtype>*>& top,
+ const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
+
+ unsigned int axis_, tiles_, outer_dim_, inner_dim_;
+};
+
} // namespace caffe
#endif // CAFFE_COMMON_LAYERS_HPP_