Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
922e23bf
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
922e23bf
编写于
9月 10, 2021
作者:
F
feng_shuai
提交者:
GitHub
9月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
change trt_tile_op half diff and add some func for CE (#35597)
上级
29cacee4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
54 addition
and
7 deletion
+54
-7
python/paddle/fluid/tests/unittests/ir/inference/test_trt_tile_op.py
...le/fluid/tests/unittests/ir/inference/test_trt_tile_op.py
+1
-1
tools/jetson_infer_op.py
tools/jetson_infer_op.py
+53
-6
未找到文件。
python/paddle/fluid/tests/unittests/ir/inference/test_trt_tile_op.py
浏览文件 @
922e23bf
...
...
@@ -112,7 +112,7 @@ class TRTTileExpandHalfTest(InferencePassTest):
def
test_check_output
(
self
):
if
core
.
is_compiled_with_cuda
():
use_gpu
=
True
self
.
check_output_with_option
(
use_gpu
,
flatten
=
True
)
self
.
check_output_with_option
(
use_gpu
,
1e-4
,
flatten
=
True
)
self
.
assertTrue
(
PassVersionChecker
.
IsCompatible
(
'tensorrt_subgraph_pass'
))
...
...
tools/jetson_infer_op.py
浏览文件 @
922e23bf
...
...
@@ -217,6 +217,10 @@ def run_multi_thread(list_file, thread_num=4):
for
item
in
thread_list
:
item
.
join
()
# add a flag
with
open
(
"flag_change_file.txt"
,
"w"
,
encoding
=
"utf-8"
)
as
f
:
f
.
write
(
"change successfully!"
)
print
(
"------change successfully!-------"
)
...
...
@@ -232,15 +236,58 @@ def transform_list_to_str(list_op):
return
res
[:
-
1
]
def
run_file_change
(
op_list_file
):
"""
if file has changed, the file should not be changed again.
:param op_list_file:
:return:
"""
if
(
os
.
path
.
exists
(
"flag_change_file.txt"
)):
print
(
"-----maybe op_file has changed, so don't need to change again------"
)
else
:
run_multi_thread
(
op_list_file
)
def
run_test_first
(
op_list_file
):
"""
run all op test.
:param op_list_file:
:return:
"""
old_list
=
get_op_list
(
op_list_file
)
new_list
=
filter
(
lambda
x
:
x
not
in
black_list
,
old_list
)
op_test
=
transform_list_to_str
(
new_list
)
os
.
system
(
"ctest -R
\"
("
+
op_test
+
")
\"
>& test_op_log.txt"
)
def
run_test_second
():
"""
run failed op again.
:return:
"""
os
.
system
(
"sed -n '/(Failed)$/p' test_op_log.txt | awk '{print $3}' >& rerun_op.txt"
)
rerun_list
=
get_op_list
(
'rerun_op.txt'
)
if
(
len
(
rerun_list
)):
print
(
"-------there are "
+
str
(
len
(
rerun_list
))
+
" op(s) need to rerun!!!-------"
)
for
failed_op
in
rerun_list
:
os
.
system
(
"ctest -R
\"
("
+
failed_op
+
")
\"
"
)
else
:
print
(
"-------all op passed successfully!!!-------"
)
if
__name__
==
'__main__'
:
arg
=
parse_arguments
()
print
(
"------start get op list!------"
)
os
.
system
(
"bash "
+
arg
.
shell_name
+
" "
+
arg
.
op_list_file
)
print
(
"------start change op file!------"
)
run_multi_thread
(
arg
.
op_list_file
)
old_list
=
get_op_list
(
arg
.
op_list_file
)
new_list
=
filter
(
lambda
x
:
x
not
in
black_list
,
old_list
)
op_test
=
transform_list_to_str
(
new_list
)
print
(
"------start run op test!------"
)
os
.
system
(
"ctest -R
\"
("
+
op_test
+
")
\"
--output-on-failure"
)
run_file_change
(
arg
.
op_list_file
)
print
(
"------start run op test first!------"
)
run_test_first
(
arg
.
op_list_file
)
print
(
"------start run failed_op test!------"
)
run_test_second
()
print
(
"------do well!------"
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录