Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
111c0b6d
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
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看板
未验证
提交
111c0b6d
编写于
8月 28, 2019
作者:
Y
Yanzhan Yang
提交者:
GitHub
8月 28, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix elementwise_add && fix run.py && add namespace change script (#1898)
上级
788238b0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
57 addition
and
7 deletion
+57
-7
mobile/src/operators/kernel/cl/elementwise_add_kernel.cpp
mobile/src/operators/kernel/cl/elementwise_add_kernel.cpp
+15
-5
mobile/tools/python/fluidtools/run.py
mobile/tools/python/fluidtools/run.py
+3
-2
mobile/tools/shell/change_mobile_namespace.sh
mobile/tools/shell/change_mobile_namespace.sh
+39
-0
未找到文件。
mobile/src/operators/kernel/cl/elementwise_add_kernel.cpp
浏览文件 @
111c0b6d
...
...
@@ -25,17 +25,27 @@ bool ElementwiseAddKernel<GPU_CL, float>::Init(
DLOG
<<
"-----init add-----"
;
CLImage
*
bias
=
reinterpret_cast
<
CLImage
*>
(
const_cast
<
CLImage
*>
(
param
->
InputY
()));
if
(
!
bias
->
isInit
())
{
bias
->
InitNormalCLImage
(
cl_helper_
.
CLContext
(),
this
->
cl_helper_
.
CLCommandQueue
());
}
DLOG
<<
" bias: "
<<
*
bias
;
if
(
bias
->
dims
().
size
()
==
4
)
{
if
(
!
bias
->
isInit
())
{
bias
->
InitNormalCLImage
(
cl_helper_
.
CLContext
(),
this
->
cl_helper_
.
CLCommandQueue
());
}
DLOG
<<
" bias: "
<<
*
bias
;
this
->
cl_helper_
.
AddKernel
(
"elementwise_add"
,
"elementwise_add_kernel.cl"
);
}
else
if
(
param
->
InputY
()
->
dims
().
size
()
==
1
)
{
if
(
param
->
Axis
()
==
param
->
InputX
()
->
dims
().
size
()
-
1
)
{
if
(
!
bias
->
isInit
())
{
bias
->
InitNormalCLImage
(
cl_helper_
.
CLContext
(),
this
->
cl_helper_
.
CLCommandQueue
());
}
DLOG
<<
" bias: "
<<
*
bias
;
this
->
cl_helper_
.
AddKernel
(
"width_add"
,
"channel_add_kernel.cl"
);
}
else
if
(
param
->
Axis
()
==
param
->
InputX
()
->
dims
().
size
()
-
3
)
{
if
(
!
bias
->
isInit
())
{
bias
->
InitCLImage
(
cl_helper_
.
CLContext
(),
this
->
cl_helper_
.
CLCommandQueue
());
}
DLOG
<<
" bias: "
<<
*
bias
;
this
->
cl_helper_
.
AddKernel
(
"channel_add"
,
"channel_add_kernel.cl"
);
}
else
{
DLOG
<<
"error:bias dims is error"
;
...
...
mobile/tools/python/fluidtools/run.py
浏览文件 @
111c0b6d
...
...
@@ -285,8 +285,9 @@ def save_all_op_output(feed_kv=None):
for
fetch
in
fetches
:
fetch_names
.
append
(
fetch
.
name
)
feed_names
=
feeds
for
fetch_name
in
fetch_names
:
output_var_filter
.
append
(
fetch_name
)
if
len
(
output_var_filter
)
>
0
:
for
fetch_name
in
fetch_names
:
output_var_filter
.
append
(
fetch_name
)
for
i
in
range
(
len
(
ops
)):
op
=
ops
[
i
]
var_name
=
None
...
...
mobile/tools/shell/change_mobile_namespace.sh
0 → 100755
浏览文件 @
111c0b6d
#!/usr/bin/env bash
# set -o xtrace
extension
=
$1
convert
()
{
perl
-pi
-e
"s/namespace paddle_mobile/namespace paddle_mobile_
${
1
}
/g"
"
${
2
}
"
perl
-pi
-e
"s/paddle_mobile::/paddle_mobile_
${
1
}
::/g"
"
${
2
}
"
}
revert
()
{
perl
-pi
-e
"s/namespace paddle_mobile_[
\w
]*/namespace paddle_mobile/g"
"
${
2
}
"
perl
-pi
-e
"s/paddle_mobile_[
\w
]*::/paddle_mobile::/g"
"
${
2
}
"
}
if
[[
$2
==
"revert"
]]
;
then
for
file
in
$(
find src
-name
"*
\.
*"
)
do
echo
"reverting
${
file
}
"
revert
$extension
$file
done
for
file
in
$(
find
test
-name
"*
\.
*"
)
do
echo
"reverting
${
file
}
"
revert
$extension
$file
done
else
for
file
in
$(
find src
-name
"*
\.
*"
)
do
echo
"converting
${
file
}
"
convert
$extension
$file
done
# for file in $(find test -name "*\.*")
# do
# echo "converting ${file}"
# convert $extension $file
# done
fi
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录