4 #include "caffe/layers/acl_sigmoid_layer.hpp"
8 template <typename Dtype>
9 void ACLSigmoidLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,
10 const vector<Blob<Dtype>*>& top) {
11 SigmoidLayer<Dtype>::LayerSetUp(bottom, top);
12 ACLBaseActivationLayer<Dtype>::LayerSetUp(bottom, top);
13 this->force_bypass_acl_path_= bypass_acl_class_layer & FLAGS_ENABLE_ACL_SIGMOID;
16 template <typename Dtype>
17 void ACLSigmoidLayer<Dtype>::SetupACLLayer(const vector<Blob<Dtype>*>& bottom,
18 const vector<Blob<Dtype>*>& top,ActivationLayerInfo::ActivationFunction type){
19 ACLBaseActivationLayer<Dtype>::SetupACLLayer(bottom, top,ActivationLayerInfo::ActivationFunction::LOGISTIC);
21 template <typename Dtype>
22 void ACLSigmoidLayer<Dtype>::Reshape(const vector<Blob<Dtype>*>& bottom,
23 const vector<Blob<Dtype>*>& top) {
24 SigmoidLayer<Dtype>::Reshape(bottom, top);
25 ACLBaseActivationLayer<Dtype>::Reshape(bottom, top);
28 template <typename Dtype>
29 void ACLSigmoidLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,
30 const vector<Blob<Dtype>*>& top) {
32 logtime_util log_time(ACL_SIGMOID_INFO);
33 #endif //USE_PROFILING
34 if (this->force_bypass_acl_path_) {
35 SigmoidLayer<Dtype>::Forward_cpu(bottom,top);
38 ACLBaseActivationLayer<Dtype>::Forward_cpu(bottom,top);
41 template <typename Dtype>
42 void ACLSigmoidLayer<Dtype>::Forward_gpu(const vector<Blob<Dtype>*>& bottom,
43 const vector<Blob<Dtype>*>& top) {
45 logtime_util log_time(ACL_SIGMOID_INFO);
46 #endif //USE_PROFILING
47 if (this->force_bypass_acl_path_) {
48 SigmoidLayer<Dtype>::Forward_cpu(bottom,top);
51 ACLBaseActivationLayer<Dtype>::Forward_gpu(bottom,top);
54 template <typename Dtype>
55 ACLSigmoidLayer<Dtype>::~ACLSigmoidLayer() {
58 INSTANTIATE_CLASS(ACLSigmoidLayer);