1 #ifndef CAFFE_CUDNN_POOLING_LAYER_HPP_ 2 #define CAFFE_CUDNN_POOLING_LAYER_HPP_ 6 #include "caffe/blob.hpp" 7 #include "caffe/layer.hpp" 8 #include "caffe/proto/caffe.pb.h" 10 #include "caffe/layers/pooling_layer.hpp" 19 template <
typename Dtype>
20 class CuDNNPoolingLayer :
public PoolingLayer<Dtype> {
22 explicit CuDNNPoolingLayer(
const LayerParameter& param)
23 : PoolingLayer<Dtype>(param), handles_setup_(false) {}
24 virtual void LayerSetUp(
const vector<Blob<Dtype>*>& bottom,
25 const vector<Blob<Dtype>*>& top);
26 virtual void Reshape(
const vector<Blob<Dtype>*>& bottom,
27 const vector<Blob<Dtype>*>& top);
28 virtual ~CuDNNPoolingLayer();
30 virtual inline int MinTopBlobs()
const {
return -1; }
31 virtual inline int ExactNumTopBlobs()
const {
return 1; }
34 virtual void Forward_gpu(
const vector<Blob<Dtype>*>& bottom,
35 const vector<Blob<Dtype>*>& top);
36 virtual void Backward_gpu(
const vector<Blob<Dtype>*>& top,
37 const vector<bool>& propagate_down,
const vector<Blob<Dtype>*>& bottom);
40 cudnnHandle_t handle_;
41 cudnnTensorDescriptor_t bottom_desc_, top_desc_;
42 cudnnPoolingDescriptor_t pooling_desc_;
43 cudnnPoolingMode_t mode_;
49 #endif // CAFFE_CUDNN_POOLING_LAYER_HPP_ A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14