FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
CaffeOnACL/src/caffe/layers/acl_tanh_layer.cpp at master · 2php/CaffeOnACL · GitHub
2php
CaffeOnACL
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
CaffeOnACL
/
src
/
caffe
/
layers
/
acl_tanh_layer.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
63 lines (52 loc) · 1.85 KB
Breadcrumbs
CaffeOnACL
/
src
/
caffe
/
layers
/
acl_tanh_layer.cpp
Copy path
File metadata and controls
63 lines (52 loc) · 1.85 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#
ifdef
USE_ACL
#
include
<
vector
>
#
include
"
caffe/layers/acl_tanh_layer.hpp
"
namespace
caffe
{
template
<
typename
Dtype>
void
ACLTanHLayer<Dtype>::LayerSetUp(
const
vector<Blob<Dtype>*>& bottom,
const
vector<Blob<Dtype>*>& top) {
TanHLayer<Dtype>::
LayerSetUp
(bottom, top);
ACLBaseActivationLayer<Dtype>::
LayerSetUp
(bottom, top);
this
->
force_bypass_acl_path_
= bypass_acl_class_layer &
FLAGS_ENABLE_ACL_TANH
;
}
template
<
typename
Dtype>
void
ACLTanHLayer<Dtype>::SetupACLLayer(
const
vector<Blob<Dtype>*>& bottom,
const
vector<Blob<Dtype>*>& top, ActivationLayerInfo::ActivationFunction type){
ACLBaseActivationLayer<Dtype>::
SetupACLLayer
(bottom, top,ActivationLayerInfo::ActivationFunction::
TANH
);
}
template
<
typename
Dtype>
void
ACLTanHLayer<Dtype>::Reshape(
const
vector<Blob<Dtype>*>& bottom,
const
vector<Blob<Dtype>*>& top) {
TanHLayer<Dtype>::
Reshape
(bottom, top);
ACLBaseActivationLayer<Dtype>::
Reshape
(bottom, top);
}
template
<
typename
Dtype>
void
ACLTanHLayer<Dtype>::Forward_cpu(
const
vector<Blob<Dtype>*>& bottom,
const
vector<Blob<Dtype>*>& top) {
#
ifdef
USE_PROFILING
logtime_util
log_time
(
ACL_TANH_INFO
);
#
endif
//
USE_PROFILING
if
(
this
->
force_bypass_acl_path_
) {
TanHLayer<Dtype>::
Forward_cpu
(bottom,top);
return
;
}
ACLBaseActivationLayer<Dtype>::
Forward_cpu
(bottom,top);
}
template
<
typename
Dtype>
void
ACLTanHLayer<Dtype>::Forward_gpu(
const
vector<Blob<Dtype>*>& bottom,
const
vector<Blob<Dtype>*>& top) {
#
ifdef
USE_PROFILING
logtime_util
log_time
(
ACL_TANH_INFO
);
#
endif
//
USE_PROFILING
if
(
this
->
force_bypass_acl_path_
) {
TanHLayer<Dtype>::
Forward_cpu
(bottom,top);
return
;
}
ACLBaseActivationLayer<Dtype>::
Forward_gpu
(bottom,top);
}
template
<
typename
Dtype>
ACLTanHLayer<Dtype>::
~ACLTanHLayer
() {
}
INSTANTIATE_CLASS
(ACLTanHLayer);
}
//
namespace caffe
#
endif
//
USE_ACL
Back
|
FazBrowse Home
|
New Git URL