1 #ifndef CAFFE_CUDNN_SOFTMAX_LAYER_HPP_ 2 #define CAFFE_CUDNN_SOFTMAX_LAYER_HPP_ 6 #include "caffe/blob.hpp" 7 #include "caffe/layer.hpp" 8 #include "caffe/proto/caffe.pb.h" 10 #include "caffe/layers/softmax_layer.hpp" 19 template <
typename Dtype>
20 class CuDNNSoftmaxLayer :
public SoftmaxLayer<Dtype> {
22 explicit CuDNNSoftmaxLayer(
const LayerParameter& param)
23 : SoftmaxLayer<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 ~CuDNNSoftmaxLayer();
31 virtual void Forward_gpu(
const vector<Blob<Dtype>*>& bottom,
32 const vector<Blob<Dtype>*>& top);
33 virtual void Backward_gpu(
const vector<Blob<Dtype>*>& top,
34 const vector<bool>& propagate_down,
const vector<Blob<Dtype>*>& bottom);
37 cudnnHandle_t handle_;
38 cudnnTensorDescriptor_t bottom_desc_;
39 cudnnTensorDescriptor_t top_desc_;
45 #endif // CAFFE_CUDNN_SOFTMAX_LAYER_HPP_ A layer factory that allows one to register layers. During runtime, registered layers can be called b...
Definition: blob.hpp:14