Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
9bae4c5a
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
338
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9bae4c5a
编写于
4月 15, 2020
作者:
Y
yanghongtian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update act_op namespace
上级
d6965c1b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
22 deletion
+14
-22
lite/kernels/hw_ascend_npu/bridges/act_op.cc
lite/kernels/hw_ascend_npu/bridges/act_op.cc
+14
-22
未找到文件。
lite/kernels/hw_ascend_npu/bridges/act_op.cc
浏览文件 @
9bae4c5a
...
@@ -93,14 +93,6 @@ int ActConverter<ge::op::Activation>(void* ctx,
...
@@ -93,14 +93,6 @@ int ActConverter<ge::op::Activation>(void* ctx,
}
else
if
(
op_type
==
"relu6"
)
{
}
else
if
(
op_type
==
"relu6"
)
{
float
Relu_clipped_coef
=
6.
f
;
float
Relu_clipped_coef
=
6.
f
;
act_op
->
set_attr_coef
(
Relu_clipped_coef
);
act_op
->
set_attr_coef
(
Relu_clipped_coef
);
}
else
if
(
op_type
==
"leaky_relu"
)
{
auto
alpha
=
op_info
->
GetAttr
<
float
>
(
"alpha"
);
act_op
->
set_attr_negative_slope
(
alpha
);
}
else
if
(
op_type
==
"hard_sigmoid"
)
{
auto
slope
=
op_info
->
GetAttr
<
float
>
(
"slope"
);
auto
offset
=
op_info
->
GetAttr
<
float
>
(
"offset"
);
act_op
->
set_attr_negative_slope
(
slope
);
act_op
->
set_attr_coef
(
offset
);
}
}
return
SUCCESS
;
return
SUCCESS
;
}
}
...
@@ -113,53 +105,53 @@ int ActConverter<ge::op::Activation>(void* ctx,
...
@@ -113,53 +105,53 @@ int ActConverter<ge::op::Activation>(void* ctx,
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
sigmoid
,
sigmoid
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Activation
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
relu
,
relu
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Activation
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
tanh
,
tanh
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Activation
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
relu_clipped
,
relu_clipped
,
kNPU
,
kNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Activation
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
relu6
,
relu6
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Activation
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
leaky_relu
,
leaky_relu
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Activation
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
abs
,
abs
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Activation
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
softsign
,
softsign
,
kNPU
,
k
HWAscend
NPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Activation
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
softplus
,
softplus
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Activation
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
hard_sigmoid
,
hard_sigmoid
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Activation
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Activation
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
log
,
log
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Log
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Log
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
square
,
square
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Square
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Square
>
);
REGISTER_SUBGRAPH_BRIDGE
(
REGISTER_SUBGRAPH_BRIDGE
(
sqrt
,
sqrt
,
kHWAscendNPU
,
kHWAscendNPU
,
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
Sqrt
>
);
paddle
::
lite
::
subgraph
::
hw_ascend_npu
::
ActConverter
<
ge
::
op
::
Sqrt
>
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录