Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
d0b5d2c2
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看板
提交
d0b5d2c2
编写于
7月 09, 2019
作者:
Y
Yanzhan Yang
提交者:
zp7
7月 09, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
print data according to its type (#1738)
上级
acfb2469
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
33 addition
and
17 deletion
+33
-17
test/net/test_net.cpp
test/net/test_net.cpp
+28
-12
tools/python/fluidtools/run.py
tools/python/fluidtools/run.py
+5
-5
未找到文件。
test/net/test_net.cpp
浏览文件 @
d0b5d2c2
...
@@ -176,6 +176,21 @@ void test(int argc, char *argv[]) {
...
@@ -176,6 +176,21 @@ void test(int argc, char *argv[]) {
if
(
out
->
memory_size
()
==
0
)
{
if
(
out
->
memory_size
()
==
0
)
{
continue
;
continue
;
}
}
if
(
out
->
type
()
==
type_id
<
int
>
())
{
auto
data
=
out
->
data
<
int
>
();
std
::
string
sample
=
""
;
if
(
!
is_sample_step
)
{
sample_step
=
len
/
sample_num
;
}
if
(
sample_step
<=
0
)
{
sample_step
=
1
;
}
for
(
int
i
=
0
;
i
<
len
;
i
+=
sample_step
)
{
sample
+=
" "
+
std
::
to_string
(
data
[
i
]);
}
std
::
cout
<<
"auto-test"
<<
" var "
<<
var_name
<<
sample
<<
std
::
endl
;
}
else
if
(
out
->
type
()
==
type_id
<
float
>
())
{
auto
data
=
out
->
data
<
float
>
();
auto
data
=
out
->
data
<
float
>
();
std
::
string
sample
=
""
;
std
::
string
sample
=
""
;
if
(
!
is_sample_step
)
{
if
(
!
is_sample_step
)
{
...
@@ -190,6 +205,7 @@ void test(int argc, char *argv[]) {
...
@@ -190,6 +205,7 @@ void test(int argc, char *argv[]) {
std
::
cout
<<
"auto-test"
std
::
cout
<<
"auto-test"
<<
" var "
<<
var_name
<<
sample
<<
std
::
endl
;
<<
" var "
<<
var_name
<<
sample
<<
std
::
endl
;
}
}
}
std
::
cout
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
;
}
}
}
}
tools/python/fluidtools/run.py
浏览文件 @
d0b5d2c2
...
@@ -382,11 +382,6 @@ def main():
...
@@ -382,11 +382,6 @@ def main():
feed_kv
=
gen_feed_kv
()
feed_kv
=
gen_feed_kv
()
save_feed_kv
(
feed_kv
)
save_feed_kv
(
feed_kv
)
feed_kv
=
load_feed_kv
()
feed_kv
=
load_feed_kv
()
pp_yellow
(
dot
+
dot
+
" checking fetch info"
)
for
fetch
in
fetches
:
fetch_name
=
fetch
.
name
fetch_shape
=
get_var_shape
(
fetch_name
)
pp_tab
(
"fetch var name : {}; fetch var shape : {}"
.
format
(
fetch_name
,
fetch_shape
),
1
)
# 预测
# 预测
pp_yellow
(
dot
+
dot
+
" checking inference"
)
pp_yellow
(
dot
+
dot
+
" checking inference"
)
outputs
=
run_model
(
feed_kv
=
feed_kv
)
outputs
=
run_model
(
feed_kv
=
feed_kv
)
...
@@ -397,6 +392,11 @@ def main():
...
@@ -397,6 +392,11 @@ def main():
# 输出所有中间结果
# 输出所有中间结果
pp_yellow
(
dot
+
dot
+
" checking output result of every op"
)
pp_yellow
(
dot
+
dot
+
" checking output result of every op"
)
save_all_op_output
(
feed_kv
=
feed_kv
)
save_all_op_output
(
feed_kv
=
feed_kv
)
pp_yellow
(
dot
+
dot
+
" checking fetch info"
)
for
fetch
in
fetches
:
fetch_name
=
fetch
.
name
fetch_shape
=
get_var_shape
(
fetch_name
)
pp_tab
(
"fetch var name : {}; fetch var shape : {}"
.
format
(
fetch_name
,
fetch_shape
),
1
)
# 开始检查mobile的正确性
# 开始检查mobile的正确性
print
(
""
)
print
(
""
)
print
(
"=================================================="
)
print
(
"=================================================="
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录