Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
242d26d4
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 2 年 前同步成功
通知
2325
Star
20933
Fork
5424
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
242d26d4
编写于
8月 08, 2023
作者:
F
Frank Lin
提交者:
GitHub
8月 09, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Set Input Type for TensorRT convert tests (#55823)
* set input type to fp16
上级
a127d7c8
变更
106
隐藏空白更改
内联
并排
Showing
106 changed file
with
601 addition
and
81 deletion
+601
-81
test/ir/inference/auto_scan_test.py
test/ir/inference/auto_scan_test.py
+76
-78
test/ir/inference/program_config.py
test/ir/inference/program_config.py
+3
-3
test/ir/inference/test_trt_convert_activation.py
test/ir/inference/test_trt_convert_activation.py
+4
-0
test/ir/inference/test_trt_convert_affine_channel.py
test/ir/inference/test_trt_convert_affine_channel.py
+4
-0
test/ir/inference/test_trt_convert_anchor_generator.py
test/ir/inference/test_trt_convert_anchor_generator.py
+4
-0
test/ir/inference/test_trt_convert_arg_max.py
test/ir/inference/test_trt_convert_arg_max.py
+4
-0
test/ir/inference/test_trt_convert_arg_min.py
test/ir/inference/test_trt_convert_arg_min.py
+4
-0
test/ir/inference/test_trt_convert_assign.py
test/ir/inference/test_trt_convert_assign.py
+4
-0
test/ir/inference/test_trt_convert_batch_norm.py
test/ir/inference/test_trt_convert_batch_norm.py
+4
-0
test/ir/inference/test_trt_convert_bilinear_interp_v2.py
test/ir/inference/test_trt_convert_bilinear_interp_v2.py
+4
-0
test/ir/inference/test_trt_convert_bitwise_not.py
test/ir/inference/test_trt_convert_bitwise_not.py
+4
-0
test/ir/inference/test_trt_convert_bmm.py
test/ir/inference/test_trt_convert_bmm.py
+4
-0
test/ir/inference/test_trt_convert_cast.py
test/ir/inference/test_trt_convert_cast.py
+4
-0
test/ir/inference/test_trt_convert_clip.py
test/ir/inference/test_trt_convert_clip.py
+4
-0
test/ir/inference/test_trt_convert_compare_and_logical.py
test/ir/inference/test_trt_convert_compare_and_logical.py
+20
-0
test/ir/inference/test_trt_convert_concat.py
test/ir/inference/test_trt_convert_concat.py
+4
-0
test/ir/inference/test_trt_convert_conv2d.py
test/ir/inference/test_trt_convert_conv2d.py
+8
-0
test/ir/inference/test_trt_convert_conv2d_fusion.py
test/ir/inference/test_trt_convert_conv2d_fusion.py
+6
-0
test/ir/inference/test_trt_convert_conv2d_transpose.py
test/ir/inference/test_trt_convert_conv2d_transpose.py
+8
-0
test/ir/inference/test_trt_convert_conv3d_transpose.py
test/ir/inference/test_trt_convert_conv3d_transpose.py
+2
-0
test/ir/inference/test_trt_convert_cross_multihead_matmul.py
test/ir/inference/test_trt_convert_cross_multihead_matmul.py
+4
-0
test/ir/inference/test_trt_convert_cumsum.py
test/ir/inference/test_trt_convert_cumsum.py
+2
-0
test/ir/inference/test_trt_convert_deformable_conv.py
test/ir/inference/test_trt_convert_deformable_conv.py
+2
-0
test/ir/inference/test_trt_convert_depthwise_conv2d.py
test/ir/inference/test_trt_convert_depthwise_conv2d.py
+6
-0
test/ir/inference/test_trt_convert_depthwise_conv2d_transpose.py
.../inference/test_trt_convert_depthwise_conv2d_transpose.py
+4
-0
test/ir/inference/test_trt_convert_dropout.py
test/ir/inference/test_trt_convert_dropout.py
+4
-0
test/ir/inference/test_trt_convert_einsum.py
test/ir/inference/test_trt_convert_einsum.py
+12
-0
test/ir/inference/test_trt_convert_elementwise.py
test/ir/inference/test_trt_convert_elementwise.py
+36
-0
test/ir/inference/test_trt_convert_elementwiseadd_transpose.py
...ir/inference/test_trt_convert_elementwiseadd_transpose.py
+2
-0
test/ir/inference/test_trt_convert_emb_eltwise_layernorm.py
test/ir/inference/test_trt_convert_emb_eltwise_layernorm.py
+4
-0
test/ir/inference/test_trt_convert_equal.py
test/ir/inference/test_trt_convert_equal.py
+4
-0
test/ir/inference/test_trt_convert_expand_as_v2.py
test/ir/inference/test_trt_convert_expand_as_v2.py
+4
-0
test/ir/inference/test_trt_convert_expand_v2.py
test/ir/inference/test_trt_convert_expand_v2.py
+8
-0
test/ir/inference/test_trt_convert_fill_any_like.py
test/ir/inference/test_trt_convert_fill_any_like.py
+4
-0
test/ir/inference/test_trt_convert_fill_constant.py
test/ir/inference/test_trt_convert_fill_constant.py
+2
-0
test/ir/inference/test_trt_convert_flash_multihead_matmul.py
test/ir/inference/test_trt_convert_flash_multihead_matmul.py
+4
-0
test/ir/inference/test_trt_convert_flatten.py
test/ir/inference/test_trt_convert_flatten.py
+16
-0
test/ir/inference/test_trt_convert_flatten_contiguous_range.py
...ir/inference/test_trt_convert_flatten_contiguous_range.py
+4
-0
test/ir/inference/test_trt_convert_flip.py
test/ir/inference/test_trt_convert_flip.py
+2
-0
test/ir/inference/test_trt_convert_fused_token_prune.py
test/ir/inference/test_trt_convert_fused_token_prune.py
+2
-0
test/ir/inference/test_trt_convert_gather.py
test/ir/inference/test_trt_convert_gather.py
+4
-0
test/ir/inference/test_trt_convert_gather_nd.py
test/ir/inference/test_trt_convert_gather_nd.py
+24
-0
test/ir/inference/test_trt_convert_gelu.py
test/ir/inference/test_trt_convert_gelu.py
+4
-0
test/ir/inference/test_trt_convert_grid_sampler.py
test/ir/inference/test_trt_convert_grid_sampler.py
+2
-0
test/ir/inference/test_trt_convert_group_norm.py
test/ir/inference/test_trt_convert_group_norm.py
+4
-0
test/ir/inference/test_trt_convert_hard_sigmoid.py
test/ir/inference/test_trt_convert_hard_sigmoid.py
+4
-0
test/ir/inference/test_trt_convert_hard_swish.py
test/ir/inference/test_trt_convert_hard_swish.py
+4
-0
test/ir/inference/test_trt_convert_index_select.py
test/ir/inference/test_trt_convert_index_select.py
+4
-0
test/ir/inference/test_trt_convert_instance_norm.py
test/ir/inference/test_trt_convert_instance_norm.py
+4
-0
test/ir/inference/test_trt_convert_inverse.py
test/ir/inference/test_trt_convert_inverse.py
+4
-0
test/ir/inference/test_trt_convert_layer_norm.py
test/ir/inference/test_trt_convert_layer_norm.py
+8
-0
test/ir/inference/test_trt_convert_leaky_relu.py
test/ir/inference/test_trt_convert_leaky_relu.py
+6
-0
test/ir/inference/test_trt_convert_lookup_table.py
test/ir/inference/test_trt_convert_lookup_table.py
+2
-0
test/ir/inference/test_trt_convert_lookup_table_v2.py
test/ir/inference/test_trt_convert_lookup_table_v2.py
+2
-0
test/ir/inference/test_trt_convert_matmul.py
test/ir/inference/test_trt_convert_matmul.py
+4
-0
test/ir/inference/test_trt_convert_matmul_v2.py
test/ir/inference/test_trt_convert_matmul_v2.py
+6
-0
test/ir/inference/test_trt_convert_mish.py
test/ir/inference/test_trt_convert_mish.py
+4
-0
test/ir/inference/test_trt_convert_multiclass_nms.py
test/ir/inference/test_trt_convert_multiclass_nms.py
+3
-0
test/ir/inference/test_trt_convert_multiclass_nms3.py
test/ir/inference/test_trt_convert_multiclass_nms3.py
+3
-0
test/ir/inference/test_trt_convert_multihead_matmul.py
test/ir/inference/test_trt_convert_multihead_matmul.py
+7
-0
test/ir/inference/test_trt_convert_multihead_matmul_roformer.py
...r/inference/test_trt_convert_multihead_matmul_roformer.py
+2
-0
test/ir/inference/test_trt_convert_nearest_interp.py
test/ir/inference/test_trt_convert_nearest_interp.py
+4
-0
test/ir/inference/test_trt_convert_nearest_interp_v2.py
test/ir/inference/test_trt_convert_nearest_interp_v2.py
+8
-0
test/ir/inference/test_trt_convert_one_hot.py
test/ir/inference/test_trt_convert_one_hot.py
+4
-0
test/ir/inference/test_trt_convert_p_norm.py
test/ir/inference/test_trt_convert_p_norm.py
+2
-0
test/ir/inference/test_trt_convert_pad.py
test/ir/inference/test_trt_convert_pad.py
+4
-0
test/ir/inference/test_trt_convert_pad3d.py
test/ir/inference/test_trt_convert_pad3d.py
+8
-0
test/ir/inference/test_trt_convert_pool2d.py
test/ir/inference/test_trt_convert_pool2d.py
+4
-0
test/ir/inference/test_trt_convert_preln_residual_bias.py
test/ir/inference/test_trt_convert_preln_residual_bias.py
+4
-0
test/ir/inference/test_trt_convert_preln_residual_no_bias.py
test/ir/inference/test_trt_convert_preln_residual_no_bias.py
+4
-0
test/ir/inference/test_trt_convert_prelu.py
test/ir/inference/test_trt_convert_prelu.py
+4
-0
test/ir/inference/test_trt_convert_qk_multihead_matmul.py
test/ir/inference/test_trt_convert_qk_multihead_matmul.py
+4
-0
test/ir/inference/test_trt_convert_range.py
test/ir/inference/test_trt_convert_range.py
+4
-0
test/ir/inference/test_trt_convert_reduce.py
test/ir/inference/test_trt_convert_reduce.py
+4
-0
test/ir/inference/test_trt_convert_reshape.py
test/ir/inference/test_trt_convert_reshape.py
+10
-0
test/ir/inference/test_trt_convert_rnn.py
test/ir/inference/test_trt_convert_rnn.py
+2
-0
test/ir/inference/test_trt_convert_roi_align.py
test/ir/inference/test_trt_convert_roi_align.py
+4
-0
test/ir/inference/test_trt_convert_roll.py
test/ir/inference/test_trt_convert_roll.py
+4
-0
test/ir/inference/test_trt_convert_scale.py
test/ir/inference/test_trt_convert_scale.py
+4
-0
test/ir/inference/test_trt_convert_scatter_nd_add.py
test/ir/inference/test_trt_convert_scatter_nd_add.py
+4
-0
test/ir/inference/test_trt_convert_set_value.py
test/ir/inference/test_trt_convert_set_value.py
+2
-0
test/ir/inference/test_trt_convert_shape.py
test/ir/inference/test_trt_convert_shape.py
+4
-0
test/ir/inference/test_trt_convert_shuffle_channel.py
test/ir/inference/test_trt_convert_shuffle_channel.py
+4
-0
test/ir/inference/test_trt_convert_slice.py
test/ir/inference/test_trt_convert_slice.py
+4
-0
test/ir/inference/test_trt_convert_softmax.py
test/ir/inference/test_trt_convert_softmax.py
+4
-0
test/ir/inference/test_trt_convert_split.py
test/ir/inference/test_trt_convert_split.py
+6
-0
test/ir/inference/test_trt_convert_square.py
test/ir/inference/test_trt_convert_square.py
+4
-0
test/ir/inference/test_trt_convert_squeeze2.py
test/ir/inference/test_trt_convert_squeeze2.py
+4
-0
test/ir/inference/test_trt_convert_stack.py
test/ir/inference/test_trt_convert_stack.py
+4
-0
test/ir/inference/test_trt_convert_strided_slice.py
test/ir/inference/test_trt_convert_strided_slice.py
+4
-0
test/ir/inference/test_trt_convert_sum.py
test/ir/inference/test_trt_convert_sum.py
+8
-0
test/ir/inference/test_trt_convert_swish.py
test/ir/inference/test_trt_convert_swish.py
+4
-0
test/ir/inference/test_trt_convert_take_along_axis.py
test/ir/inference/test_trt_convert_take_along_axis.py
+4
-0
test/ir/inference/test_trt_convert_temporal_shift.py
test/ir/inference/test_trt_convert_temporal_shift.py
+4
-0
test/ir/inference/test_trt_convert_tile.py
test/ir/inference/test_trt_convert_tile.py
+8
-0
test/ir/inference/test_trt_convert_top_k.py
test/ir/inference/test_trt_convert_top_k.py
+4
-0
test/ir/inference/test_trt_convert_top_k_v2.py
test/ir/inference/test_trt_convert_top_k_v2.py
+4
-0
test/ir/inference/test_trt_convert_trans_layernorm.py
test/ir/inference/test_trt_convert_trans_layernorm.py
+2
-0
test/ir/inference/test_trt_convert_transpose.py
test/ir/inference/test_trt_convert_transpose.py
+4
-0
test/ir/inference/test_trt_convert_unary.py
test/ir/inference/test_trt_convert_unary.py
+8
-0
test/ir/inference/test_trt_convert_unbind.py
test/ir/inference/test_trt_convert_unbind.py
+2
-0
test/ir/inference/test_trt_convert_unfold.py
test/ir/inference/test_trt_convert_unfold.py
+4
-0
test/ir/inference/test_trt_convert_unsqueeze2.py
test/ir/inference/test_trt_convert_unsqueeze2.py
+4
-0
test/ir/inference/test_trt_convert_where.py
test/ir/inference/test_trt_convert_where.py
+4
-0
test/ir/inference/test_trt_convert_yolo_box.py
test/ir/inference/test_trt_convert_yolo_box.py
+4
-0
test/ir/inference/test_trt_convert_yolo_box_head.py
test/ir/inference/test_trt_convert_yolo_box_head.py
+1
-0
未找到文件。
test/ir/inference/auto_scan_test.py
浏览文件 @
242d26d4
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
import
abc
import
abc
import
enum
import
enum
import
logging
import
os
import
os
import
shutil
import
shutil
import
time
import
time
...
@@ -35,9 +34,12 @@ from program_config import (
...
@@ -35,9 +34,12 @@ from program_config import (
import
paddle
import
paddle
import
paddle.inference
as
paddle_infer
import
paddle.inference
as
paddle_infer
from
paddle.fluid.core
import
PassVersionChecker
from
paddle.fluid.core
import
PassVersionChecker
from
paddle.static.log_helper
import
get_logger
LOGLEVEL
=
os
.
environ
.
get
(
"PADDLE_TEST_LOGLEVEL"
,
"INFO"
).
upper
()
LOGLEVEL
=
os
.
environ
.
get
(
"PADDLE_TEST_LOGLEVEL"
,
"INFO"
).
upper
()
logging
.
basicConfig
(
level
=
LOGLEVEL
,
format
=
"%(message)s"
)
logging
=
get_logger
(
__name__
,
LOGLEVEL
,
fmt
=
'%(asctime)s-%(levelname)s: %(message)s'
)
settings
.
register_profile
(
settings
.
register_profile
(
"ci"
,
"ci"
,
...
@@ -662,9 +664,6 @@ class TrtLayerAutoScanTest(AutoScanTest):
...
@@ -662,9 +664,6 @@ class TrtLayerAutoScanTest(AutoScanTest):
)
)
return
config
return
config
def
get_avalible_input_type
(
self
)
->
List
[
np
.
dtype
]:
return
[
np
.
float32
]
def
assert_tensors_near
(
def
assert_tensors_near
(
self
,
self
,
atol
:
float
,
atol
:
float
,
...
@@ -747,10 +746,13 @@ class TrtLayerAutoScanTest(AutoScanTest):
...
@@ -747,10 +746,13 @@ class TrtLayerAutoScanTest(AutoScanTest):
if
not
skip_baseline
:
if
not
skip_baseline
:
# baseline: gpu run, we only test float32
# baseline: gpu run, we only test float32
gpu_config
=
self
.
create_inference_config
(
use_trt
=
False
)
gpu_config
=
self
.
create_inference_config
(
use_trt
=
False
)
prog_config
=
prog_config
.
set_input_type
(
np
.
float16
).
set_input_type
(
np
.
float32
)
baseline_result
=
self
.
run_test_config
(
baseline_result
=
self
.
run_test_config
(
model
,
model
,
params
,
params
,
prog_config
.
set_input_type
(
np
.
float32
)
,
prog_config
,
gpu_config
,
gpu_config
,
feed_data
,
feed_data
,
)
)
...
@@ -761,82 +763,78 @@ class TrtLayerAutoScanTest(AutoScanTest):
...
@@ -761,82 +763,78 @@ class TrtLayerAutoScanTest(AutoScanTest):
nodes_num
,
nodes_num
,
threshold
,
threshold
,
)
in
self
.
sample_predictor_configs
(
prog_config
):
)
in
self
.
sample_predictor_configs
(
prog_config
):
for
input_type
in
self
.
get_avalible_input_type
():
if
os
.
path
.
exists
(
self
.
cache_dir
):
prog_config
=
prog_config
.
set_input_type
(
input_type
)
shutil
.
rmtree
(
self
.
cache_dir
)
if
os
.
path
.
exists
(
self
.
cache_dir
):
shutil
.
rmtree
(
self
.
cache_dir
)
if
isinstance
(
threshold
,
float
):
if
isinstance
(
threshold
,
float
):
atol
=
threshold
atol
=
threshold
rtol
=
1e-8
rtol
=
1e-8
elif
isinstance
(
threshold
,
list
)
or
isinstance
(
elif
isinstance
(
threshold
,
list
)
or
isinstance
(
threshold
,
tuple
threshold
,
tuple
):
):
atol
=
threshold
[
0
]
atol
=
threshold
[
0
]
rtol
=
threshold
[
1
]
rtol
=
threshold
[
1
]
else
:
else
:
raise
NotImplementedError
raise
NotImplementedError
is_fp8
=
(
is_fp8
=
(
pred_config
.
tensorrt_precision_mode
()
pred_config
.
tensorrt_precision_mode
()
==
paddle_infer
.
PrecisionType
.
Int8
==
paddle_infer
.
PrecisionType
.
Int8
)
)
if
(
not
is_fp8
and
quant
)
or
(
is_fp8
and
not
quant
):
if
(
not
is_fp8
and
quant
)
or
(
is_fp8
and
not
quant
):
continue
continue
ignore_flag
=
False
ignore_flag
=
False
for
teller
,
reason
,
note
in
self
.
ignore_cases
:
for
teller
,
reason
,
note
in
self
.
ignore_cases
:
if
teller
(
prog_config
,
pred_config
):
if
teller
(
prog_config
,
pred_config
):
ignore_flag
=
True
ignore_flag
=
True
if
reason
==
IgnoreReasons
.
TRT_NOT_IMPLEMENTED
:
if
reason
==
IgnoreReasons
.
TRT_NOT_IMPLEMENTED
:
self
.
ignore_log
(
self
.
ignore_log
(
f
"[TRT_NOT_IMPLEMENTED]
{
note
}
vs
{
self
.
inference_config_str
(
pred_config
)
}
"
f
"[TRT_NOT_IMPLEMENTED]
{
note
}
vs
{
self
.
inference_config_str
(
pred_config
)
}
"
)
elif
reason
==
IgnoreReasons
.
TRT_NOT_SUPPORT
:
self
.
ignore_log
(
f
"[TRT_NOT_SUPPORT]
{
note
}
vs
{
self
.
inference_config_str
(
pred_config
)
}
"
)
else
:
raise
NotImplementedError
break
if
ignore_flag
:
continue
try
:
pred_config_deserialize
=
paddle_infer
.
Config
(
pred_config
)
trt_result
=
self
.
run_test_config
(
model
,
params
,
prog_config
,
pred_config
,
feed_data
)
self
.
assert_tensors_near
(
atol
,
rtol
,
trt_result
,
baseline_result
)
trt_engine_num
,
paddle_op_num
=
nodes_num
self
.
assert_op_size
(
trt_engine_num
,
paddle_op_num
)
# deserialize test
if
trt_engine_num
>
0
:
self
.
run_test_config
(
model
,
params
,
prog_config
,
pred_config_deserialize
,
feed_data
,
)
)
elif
reason
==
IgnoreReasons
.
TRT_NOT_SUPPORT
:
self
.
ignore_log
(
f
"[TRT_NOT_SUPPORT]
{
note
}
vs
{
self
.
inference_config_str
(
pred_config
)
}
"
)
else
:
raise
NotImplementedError
break
self
.
success_log
(
f
"program_config:
{
prog_config
}
"
)
if
ignore_flag
:
self
.
success_log
(
continue
f
"predictor_config:
{
self
.
inference_config_str
(
pred_config
)
}
"
)
try
:
except
Exception
as
e
:
pred_config_deserialize
=
paddle_infer
.
Config
(
pred_config
)
self
.
fail_log
(
f
"program_config:
{
prog_config
}
"
)
trt_result
=
self
.
run_test_config
(
self
.
fail_log
(
model
,
params
,
prog_config
,
pred_config
,
feed_data
f
"predictor_config:
{
self
.
inference_config_str
(
pred_config
)
}
"
)
self
.
assert_tensors_near
(
atol
,
rtol
,
trt_result
,
baseline_result
)
trt_engine_num
,
paddle_op_num
=
nodes_num
self
.
assert_op_size
(
trt_engine_num
,
paddle_op_num
)
# deserialize test
if
trt_engine_num
>
0
:
self
.
run_test_config
(
model
,
params
,
prog_config
,
pred_config_deserialize
,
feed_data
,
)
)
self
.
fail_log
(
f
"
\033
[1;31m ERROR INFO:
{
e
}
\033
[0m"
)
all_passes
=
False
self
.
success_log
(
f
"program_config:
{
prog_config
}
"
)
self
.
success_log
(
f
"predictor_config:
{
self
.
inference_config_str
(
pred_config
)
}
"
)
except
Exception
as
e
:
self
.
fail_log
(
f
"program_config:
{
prog_config
}
"
)
self
.
fail_log
(
f
"predictor_config:
{
self
.
inference_config_str
(
pred_config
)
}
"
)
self
.
fail_log
(
f
"
\033
[1;31m ERROR INFO:
{
e
}
\033
[0m"
)
all_passes
=
False
self
.
assertTrue
(
all_passes
)
self
.
assertTrue
(
all_passes
)
...
...
test/ir/inference/program_config.py
浏览文件 @
242d26d4
...
@@ -67,7 +67,7 @@ class TensorConfig:
...
@@ -67,7 +67,7 @@ class TensorConfig:
def
__repr__
(
self
):
def
__repr__
(
self
):
return
str
({
'shape'
:
self
.
shape
,
'lod'
:
self
.
lod
,
'dtype'
:
self
.
dtype
})
return
str
({
'shape'
:
self
.
shape
,
'lod'
:
self
.
lod
,
'dtype'
:
self
.
dtype
})
def
astyp
e
(
self
,
type
:
np
.
dtype
):
def
convert_type_inplac
e
(
self
,
type
:
np
.
dtype
):
self
.
data
=
self
.
data
.
astype
(
type
)
self
.
data
=
self
.
data
.
astype
(
type
)
self
.
dtype
=
self
.
data
.
dtype
self
.
dtype
=
self
.
data
.
dtype
return
self
return
self
...
@@ -277,9 +277,9 @@ class ProgramConfig:
...
@@ -277,9 +277,9 @@ class ProgramConfig:
def
set_input_type
(
self
,
type
:
np
.
dtype
):
def
set_input_type
(
self
,
type
:
np
.
dtype
):
for
inp
in
self
.
inputs
.
values
():
for
inp
in
self
.
inputs
.
values
():
inp
.
astyp
e
(
type
)
inp
.
convert_type_inplac
e
(
type
)
for
weight
in
self
.
weights
.
values
():
for
weight
in
self
.
weights
.
values
():
weight
.
astyp
e
(
type
)
weight
.
convert_type_inplac
e
(
type
)
return
self
return
self
def
get_input_type
(
self
)
->
np
.
dtype
:
def
get_input_type
(
self
)
->
np
.
dtype
:
...
...
test/ir/inference/test_trt_convert_activation.py
浏览文件 @
242d26d4
...
@@ -178,10 +178,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
...
@@ -178,10 +178,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -189,10 +191,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
...
@@ -189,10 +191,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_affine_channel.py
浏览文件 @
242d26d4
...
@@ -133,10 +133,12 @@ class TrtConvertAffineChannelTest(TrtLayerAutoScanTest):
...
@@ -133,10 +133,12 @@ class TrtConvertAffineChannelTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -144,10 +146,12 @@ class TrtConvertAffineChannelTest(TrtLayerAutoScanTest):
...
@@ -144,10 +146,12 @@ class TrtConvertAffineChannelTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_anchor_generator.py
浏览文件 @
242d26d4
...
@@ -107,10 +107,12 @@ class TrtConvertAnchorGeneratorTest(TrtLayerAutoScanTest):
...
@@ -107,10 +107,12 @@ class TrtConvertAnchorGeneratorTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -118,10 +120,12 @@ class TrtConvertAnchorGeneratorTest(TrtLayerAutoScanTest):
...
@@ -118,10 +120,12 @@ class TrtConvertAnchorGeneratorTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_arg_max.py
浏览文件 @
242d26d4
...
@@ -118,10 +118,12 @@ class TrtConvertArgMaxTest(TrtLayerAutoScanTest):
...
@@ -118,10 +118,12 @@ class TrtConvertArgMaxTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -129,10 +131,12 @@ class TrtConvertArgMaxTest(TrtLayerAutoScanTest):
...
@@ -129,10 +131,12 @@ class TrtConvertArgMaxTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_arg_min.py
浏览文件 @
242d26d4
...
@@ -118,10 +118,12 @@ class TrtConvertArgMinTest(TrtLayerAutoScanTest):
...
@@ -118,10 +118,12 @@ class TrtConvertArgMinTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -129,10 +131,12 @@ class TrtConvertArgMinTest(TrtLayerAutoScanTest):
...
@@ -129,10 +131,12 @@ class TrtConvertArgMinTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_assign.py
浏览文件 @
242d26d4
...
@@ -133,10 +133,12 @@ class TrtConvertAssignTest(TrtLayerAutoScanTest):
...
@@ -133,10 +133,12 @@ class TrtConvertAssignTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
@@ -144,10 +146,12 @@ class TrtConvertAssignTest(TrtLayerAutoScanTest):
...
@@ -144,10 +146,12 @@ class TrtConvertAssignTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
...
...
test/ir/inference/test_trt_convert_batch_norm.py
浏览文件 @
242d26d4
...
@@ -232,10 +232,12 @@ class TrtConvertBatchNormTest(TrtLayerAutoScanTest):
...
@@ -232,10 +232,12 @@ class TrtConvertBatchNormTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -243,10 +245,12 @@ class TrtConvertBatchNormTest(TrtLayerAutoScanTest):
...
@@ -243,10 +245,12 @@ class TrtConvertBatchNormTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_bilinear_interp_v2.py
浏览文件 @
242d26d4
...
@@ -120,10 +120,12 @@ class TrtConvertBilinearInterpV2Test(TrtLayerAutoScanTest):
...
@@ -120,10 +120,12 @@ class TrtConvertBilinearInterpV2Test(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
@@ -131,10 +133,12 @@ class TrtConvertBilinearInterpV2Test(TrtLayerAutoScanTest):
...
@@ -131,10 +133,12 @@ class TrtConvertBilinearInterpV2Test(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
...
...
test/ir/inference/test_trt_convert_bitwise_not.py
浏览文件 @
242d26d4
...
@@ -133,10 +133,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
...
@@ -133,10 +133,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
...
@@ -144,10 +146,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
...
@@ -144,10 +146,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
...
...
test/ir/inference/test_trt_convert_bmm.py
浏览文件 @
242d26d4
...
@@ -98,10 +98,12 @@ class TrtConvertBmmTest_dynamic(TrtLayerAutoScanTest):
...
@@ -98,10 +98,12 @@ class TrtConvertBmmTest_dynamic(TrtLayerAutoScanTest):
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -115,10 +117,12 @@ class TrtConvertBmmTest_dynamic(TrtLayerAutoScanTest):
...
@@ -115,10 +117,12 @@ class TrtConvertBmmTest_dynamic(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
tol_fp32
),
tol_fp32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
tol_half
),
tol_half
...
...
test/ir/inference/test_trt_convert_cast.py
浏览文件 @
242d26d4
...
@@ -164,10 +164,12 @@ class TrtConvertCastTest(TrtLayerAutoScanTest):
...
@@ -164,10 +164,12 @@ class TrtConvertCastTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
@@ -175,10 +177,12 @@ class TrtConvertCastTest(TrtLayerAutoScanTest):
...
@@ -175,10 +177,12 @@ class TrtConvertCastTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
...
...
test/ir/inference/test_trt_convert_clip.py
浏览文件 @
242d26d4
...
@@ -143,10 +143,12 @@ class TrtConvertClipTest(TrtLayerAutoScanTest):
...
@@ -143,10 +143,12 @@ class TrtConvertClipTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -154,10 +156,12 @@ class TrtConvertClipTest(TrtLayerAutoScanTest):
...
@@ -154,10 +156,12 @@ class TrtConvertClipTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_compare_and_logical.py
浏览文件 @
242d26d4
...
@@ -153,10 +153,12 @@ class TrtConvertLogicalTest(TrtLayerAutoScanTest):
...
@@ -153,10 +153,12 @@ class TrtConvertLogicalTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -164,10 +166,12 @@ class TrtConvertLogicalTest(TrtLayerAutoScanTest):
...
@@ -164,10 +166,12 @@ class TrtConvertLogicalTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -295,10 +299,12 @@ class TrtConvertCompareTest(TrtLayerAutoScanTest):
...
@@ -295,10 +299,12 @@ class TrtConvertCompareTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -306,10 +312,12 @@ class TrtConvertCompareTest(TrtLayerAutoScanTest):
...
@@ -306,10 +312,12 @@ class TrtConvertCompareTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -454,10 +462,12 @@ class TrtConvertLessEqualTest(TrtLayerAutoScanTest):
...
@@ -454,10 +462,12 @@ class TrtConvertLessEqualTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -465,10 +475,12 @@ class TrtConvertLessEqualTest(TrtLayerAutoScanTest):
...
@@ -465,10 +475,12 @@ class TrtConvertLessEqualTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -613,10 +625,12 @@ class TrtConvertGreaterEqualTest(TrtLayerAutoScanTest):
...
@@ -613,10 +625,12 @@ class TrtConvertGreaterEqualTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -624,10 +638,12 @@ class TrtConvertGreaterEqualTest(TrtLayerAutoScanTest):
...
@@ -624,10 +638,12 @@ class TrtConvertGreaterEqualTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -750,10 +766,12 @@ class TrtConvertCompareSkipTest(TrtLayerAutoScanTest):
...
@@ -750,10 +766,12 @@ class TrtConvertCompareSkipTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -761,10 +779,12 @@ class TrtConvertCompareSkipTest(TrtLayerAutoScanTest):
...
@@ -761,10 +779,12 @@ class TrtConvertCompareSkipTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_concat.py
浏览文件 @
242d26d4
...
@@ -320,10 +320,12 @@ class TrtConvertConcatTest(TrtLayerAutoScanTest):
...
@@ -320,10 +320,12 @@ class TrtConvertConcatTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -331,10 +333,12 @@ class TrtConvertConcatTest(TrtLayerAutoScanTest):
...
@@ -331,10 +333,12 @@ class TrtConvertConcatTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_conv2d.py
浏览文件 @
242d26d4
...
@@ -171,14 +171,17 @@ class TrtConvertConv2dTest(TrtLayerAutoScanTest):
...
@@ -171,14 +171,17 @@ class TrtConvertConv2dTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
program_config
.
set_input_type
(
np
.
int8
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-2
,
1e-2
)
),
(
1e-2
,
1e-2
)
...
@@ -186,14 +189,17 @@ class TrtConvertConv2dTest(TrtLayerAutoScanTest):
...
@@ -186,14 +189,17 @@ class TrtConvertConv2dTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
program_config
.
set_input_type
(
np
.
int8
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-2
,
1e-2
)
),
(
1e-2
,
1e-2
)
...
@@ -356,11 +362,13 @@ class TrtConvertConv2dNotPersistableTest(TrtLayerAutoScanTest):
...
@@ -356,11 +362,13 @@ class TrtConvertConv2dNotPersistableTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-2
,
1e-2
)
),
(
1e-2
,
1e-2
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-2
,
1e-2
)
),
(
1e-2
,
1e-2
)
...
...
test/ir/inference/test_trt_convert_conv2d_fusion.py
浏览文件 @
242d26d4
...
@@ -179,14 +179,17 @@ class TrtConvertConv2dFusionTest(TrtLayerAutoScanTest):
...
@@ -179,14 +179,17 @@ class TrtConvertConv2dFusionTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
program_config
.
set_input_type
(
np
.
int8
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -194,14 +197,17 @@ class TrtConvertConv2dFusionTest(TrtLayerAutoScanTest):
...
@@ -194,14 +197,17 @@ class TrtConvertConv2dFusionTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
program_config
.
set_input_type
(
np
.
int8
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_conv2d_transpose.py
浏览文件 @
242d26d4
...
@@ -194,10 +194,12 @@ class TrtConvertConv2dTransposeTest(TrtLayerAutoScanTest):
...
@@ -194,10 +194,12 @@ class TrtConvertConv2dTransposeTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -208,10 +210,12 @@ class TrtConvertConv2dTransposeTest(TrtLayerAutoScanTest):
...
@@ -208,10 +210,12 @@ class TrtConvertConv2dTransposeTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -338,10 +342,12 @@ class TrtConvertConv2dTransposeTest2(TrtLayerAutoScanTest):
...
@@ -338,10 +342,12 @@ class TrtConvertConv2dTransposeTest2(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-4
),
1e-4
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e0
,
1e-3
)
),
(
1e0
,
1e-3
)
...
@@ -349,10 +355,12 @@ class TrtConvertConv2dTransposeTest2(TrtLayerAutoScanTest):
...
@@ -349,10 +355,12 @@ class TrtConvertConv2dTransposeTest2(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-4
),
1e-4
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e0
,
1e-3
)
),
(
1e0
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_conv3d_transpose.py
浏览文件 @
242d26d4
...
@@ -118,6 +118,7 @@ class TrtConvertConv3dTransposeTest(TrtLayerAutoScanTest):
...
@@ -118,6 +118,7 @@ class TrtConvertConv3dTransposeTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -125,6 +126,7 @@ class TrtConvertConv3dTransposeTest(TrtLayerAutoScanTest):
...
@@ -125,6 +126,7 @@ class TrtConvertConv3dTransposeTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_cross_multihead_matmul.py
浏览文件 @
242d26d4
...
@@ -270,17 +270,21 @@ class TrtConvertCrossMultiHeadMatmulTest(TrtLayerAutoScanTest):
...
@@ -270,17 +270,21 @@ class TrtConvertCrossMultiHeadMatmulTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
yield
self
.
create_inference_config
(),
(
1
,
4
),
(
1e-5
,
1e-5
)
yield
self
.
create_inference_config
(),
(
1
,
4
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
4
),
(
1e-2
,
1e-3
)
yield
self
.
create_inference_config
(),
(
1
,
4
),
(
1e-2
,
1e-3
)
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-4
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-4
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-2
,
1e-2
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-2
,
1e-2
)
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
...
test/ir/inference/test_trt_convert_cumsum.py
浏览文件 @
242d26d4
...
@@ -175,10 +175,12 @@ class TrtConvertCumsum(TrtLayerAutoScanTest):
...
@@ -175,10 +175,12 @@ class TrtConvertCumsum(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
...
...
test/ir/inference/test_trt_convert_deformable_conv.py
浏览文件 @
242d26d4
...
@@ -219,11 +219,13 @@ class TrtConvertDeformableConvTest(TrtLayerAutoScanTest):
...
@@ -219,11 +219,13 @@ class TrtConvertDeformableConvTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
...
...
test/ir/inference/test_trt_convert_depthwise_conv2d.py
浏览文件 @
242d26d4
...
@@ -151,13 +151,16 @@ class TrtConvertDepthwiseConv2dTest(TrtLayerAutoScanTest):
...
@@ -151,13 +151,16 @@ class TrtConvertDepthwiseConv2dTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
1e-5
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
1e-3
,
1e-3
,
1e-3
,
1e-3
,
)
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
program_config
.
set_input_type
(
np
.
int8
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
1e-3
,
1e-3
,
1e-3
,
1e-3
,
...
@@ -166,13 +169,16 @@ class TrtConvertDepthwiseConv2dTest(TrtLayerAutoScanTest):
...
@@ -166,13 +169,16 @@ class TrtConvertDepthwiseConv2dTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
1e-5
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
1e-3
,
1e-3
,
1e-3
,
1e-3
,
)
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
program_config
.
set_input_type
(
np
.
int8
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
1e-3
,
1e-3
,
1e-3
,
1e-3
,
...
...
test/ir/inference/test_trt_convert_depthwise_conv2d_transpose.py
浏览文件 @
242d26d4
...
@@ -154,10 +154,12 @@ class TrtConvertDepthwiseConv2dTransposeTest(TrtLayerAutoScanTest):
...
@@ -154,10 +154,12 @@ class TrtConvertDepthwiseConv2dTransposeTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -168,10 +170,12 @@ class TrtConvertDepthwiseConv2dTransposeTest(TrtLayerAutoScanTest):
...
@@ -168,10 +170,12 @@ class TrtConvertDepthwiseConv2dTransposeTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_dropout.py
浏览文件 @
242d26d4
...
@@ -137,10 +137,12 @@ class TrtConvertDropoutTest(TrtLayerAutoScanTest):
...
@@ -137,10 +137,12 @@ class TrtConvertDropoutTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -148,10 +150,12 @@ class TrtConvertDropoutTest(TrtLayerAutoScanTest):
...
@@ -148,10 +150,12 @@ class TrtConvertDropoutTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_einsum.py
浏览文件 @
242d26d4
...
@@ -146,10 +146,12 @@ class TrtConvertEinsumTest_SingleOperand(TrtLayerAutoScanTest):
...
@@ -146,10 +146,12 @@ class TrtConvertEinsumTest_SingleOperand(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
...
@@ -157,10 +159,12 @@ class TrtConvertEinsumTest_SingleOperand(TrtLayerAutoScanTest):
...
@@ -157,10 +159,12 @@ class TrtConvertEinsumTest_SingleOperand(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
...
@@ -326,10 +330,12 @@ class TrtConvertEinsumTest_DoubuleOperand_Vector_Matrix(TrtLayerAutoScanTest):
...
@@ -326,10 +330,12 @@ class TrtConvertEinsumTest_DoubuleOperand_Vector_Matrix(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
...
@@ -337,10 +343,12 @@ class TrtConvertEinsumTest_DoubuleOperand_Vector_Matrix(TrtLayerAutoScanTest):
...
@@ -337,10 +343,12 @@ class TrtConvertEinsumTest_DoubuleOperand_Vector_Matrix(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
...
@@ -456,10 +464,12 @@ class TrtConvertEinsumTest_DoubuleOperand_Matrix_Matrix(TrtLayerAutoScanTest):
...
@@ -456,10 +464,12 @@ class TrtConvertEinsumTest_DoubuleOperand_Matrix_Matrix(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
...
@@ -467,10 +477,12 @@ class TrtConvertEinsumTest_DoubuleOperand_Matrix_Matrix(TrtLayerAutoScanTest):
...
@@ -467,10 +477,12 @@ class TrtConvertEinsumTest_DoubuleOperand_Matrix_Matrix(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
...
...
test/ir/inference/test_trt_convert_elementwise.py
浏览文件 @
242d26d4
...
@@ -139,10 +139,12 @@ class TrtConvertElementwiseTestOneInputSpecialCase0(TrtLayerAutoScanTest):
...
@@ -139,10 +139,12 @@ class TrtConvertElementwiseTestOneInputSpecialCase0(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -150,10 +152,12 @@ class TrtConvertElementwiseTestOneInputSpecialCase0(TrtLayerAutoScanTest):
...
@@ -150,10 +152,12 @@ class TrtConvertElementwiseTestOneInputSpecialCase0(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -270,10 +274,12 @@ class TrtConvertElementwiseTestOneInputSpecialCase1(TrtLayerAutoScanTest):
...
@@ -270,10 +274,12 @@ class TrtConvertElementwiseTestOneInputSpecialCase1(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -281,10 +287,12 @@ class TrtConvertElementwiseTestOneInputSpecialCase1(TrtLayerAutoScanTest):
...
@@ -281,10 +287,12 @@ class TrtConvertElementwiseTestOneInputSpecialCase1(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -431,10 +439,12 @@ class TrtConvertElementwiseTestOneInput(TrtLayerAutoScanTest):
...
@@ -431,10 +439,12 @@ class TrtConvertElementwiseTestOneInput(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -442,10 +452,12 @@ class TrtConvertElementwiseTestOneInput(TrtLayerAutoScanTest):
...
@@ -442,10 +452,12 @@ class TrtConvertElementwiseTestOneInput(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -599,10 +611,12 @@ class TrtConvertElementwiseTestTwoInputWithoutBroadcast(TrtLayerAutoScanTest):
...
@@ -599,10 +611,12 @@ class TrtConvertElementwiseTestTwoInputWithoutBroadcast(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -610,8 +624,10 @@ class TrtConvertElementwiseTestTwoInputWithoutBroadcast(TrtLayerAutoScanTest):
...
@@ -610,8 +624,10 @@ class TrtConvertElementwiseTestTwoInputWithoutBroadcast(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-3
,
1e-3
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-3
,
1e-3
)
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -770,15 +786,19 @@ class TrtConvertElementwiseTestTwoInputWithBroadcast(TrtLayerAutoScanTest):
...
@@ -770,15 +786,19 @@ class TrtConvertElementwiseTestTwoInputWithBroadcast(TrtLayerAutoScanTest):
clear_dynamic_shape
()
clear_dynamic_shape
()
if
self
.
shape1
[
0
]
==
self
.
shape2
[
0
]:
if
self
.
shape1
[
0
]
==
self
.
shape2
[
0
]:
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-3
,
1e-3
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-3
,
1e-3
)
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-3
,
1e-3
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-3
,
1e-3
)
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -921,15 +941,19 @@ class TrtConvertElementwiseTestOneInputCornerCase(TrtLayerAutoScanTest):
...
@@ -921,15 +941,19 @@ class TrtConvertElementwiseTestOneInputCornerCase(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
3
),
(
1e-5
,
1e-5
)
yield
self
.
create_inference_config
(),
(
0
,
3
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
3
),
(
1e-3
,
1e-3
)
yield
self
.
create_inference_config
(),
(
0
,
3
),
(
1e-3
,
1e-3
)
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-5
,
1e-5
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-3
,
1e-3
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-3
,
1e-3
)
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -1069,10 +1093,12 @@ class TrtConvertElementwiseTestTwoInputSkipCase(TrtLayerAutoScanTest):
...
@@ -1069,10 +1093,12 @@ class TrtConvertElementwiseTestTwoInputSkipCase(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -1080,8 +1106,10 @@ class TrtConvertElementwiseTestTwoInputSkipCase(TrtLayerAutoScanTest):
...
@@ -1080,8 +1106,10 @@ class TrtConvertElementwiseTestTwoInputSkipCase(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
(
1e-5
,
1e-5
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
(
1e-3
,
1e-3
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
(
1e-3
,
1e-3
)
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -1187,10 +1215,12 @@ class TrtConvertPowOp(TrtLayerAutoScanTest):
...
@@ -1187,10 +1215,12 @@ class TrtConvertPowOp(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -1198,10 +1228,12 @@ class TrtConvertPowOp(TrtLayerAutoScanTest):
...
@@ -1198,10 +1228,12 @@ class TrtConvertPowOp(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -1347,10 +1379,12 @@ class TrtConvertElementwise0D(TrtLayerAutoScanTest):
...
@@ -1347,10 +1379,12 @@ class TrtConvertElementwise0D(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -1358,10 +1392,12 @@ class TrtConvertElementwise0D(TrtLayerAutoScanTest):
...
@@ -1358,10 +1392,12 @@ class TrtConvertElementwise0D(TrtLayerAutoScanTest):
# # for dynamic_shape
# # for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_elementwiseadd_transpose.py
浏览文件 @
242d26d4
...
@@ -162,10 +162,12 @@ class TrtConvertElementwiseaddTransposeTest(TrtLayerAutoScanTest):
...
@@ -162,10 +162,12 @@ class TrtConvertElementwiseaddTransposeTest(TrtLayerAutoScanTest):
# just support dynamic_shape
# just support dynamic_shape
generate_dynamic_shape
(
attrs
,
inputs
)
generate_dynamic_shape
(
attrs
,
inputs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
),
(
...
...
test/ir/inference/test_trt_convert_emb_eltwise_layernorm.py
浏览文件 @
242d26d4
...
@@ -293,15 +293,19 @@ class TrtConvertEmbEltwiseLayernormTest1(TrtLayerAutoScanTest):
...
@@ -293,15 +293,19 @@ class TrtConvertEmbEltwiseLayernormTest1(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
5
),
1e-5
yield
self
.
create_inference_config
(),
(
0
,
5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
5
),
2e-2
yield
self
.
create_inference_config
(),
(
0
,
5
),
2e-2
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
4
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
4
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
4
),
2e-2
yield
self
.
create_inference_config
(),
(
1
,
4
),
2e-2
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_equal.py
浏览文件 @
242d26d4
...
@@ -157,10 +157,12 @@ class TrtConvertEqualOneInputCornerCase(TrtLayerAutoScanTest):
...
@@ -157,10 +157,12 @@ class TrtConvertEqualOneInputCornerCase(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -168,10 +170,12 @@ class TrtConvertEqualOneInputCornerCase(TrtLayerAutoScanTest):
...
@@ -168,10 +170,12 @@ class TrtConvertEqualOneInputCornerCase(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_expand_as_v2.py
浏览文件 @
242d26d4
...
@@ -154,10 +154,12 @@ class TrtConvertExpandASV2Test(TrtLayerAutoScanTest):
...
@@ -154,10 +154,12 @@ class TrtConvertExpandASV2Test(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
@@ -244,9 +246,11 @@ class TrtConvertExpandV2Test2(TrtLayerAutoScanTest):
...
@@ -244,9 +246,11 @@ class TrtConvertExpandV2Test2(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
# fill_constant will be folded by constnt folding pass!
# fill_constant will be folded by constnt folding pass!
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
...
test/ir/inference/test_trt_convert_expand_v2.py
浏览文件 @
242d26d4
...
@@ -147,10 +147,12 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
...
@@ -147,10 +147,12 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -158,10 +160,12 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
...
@@ -158,10 +160,12 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
@@ -248,9 +252,11 @@ class TrtConvertExpandV2Test2(TrtLayerAutoScanTest):
...
@@ -248,9 +252,11 @@ class TrtConvertExpandV2Test2(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
# fill_constant will be folded by constnt folding pass!
# fill_constant will be folded by constnt folding pass!
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -392,9 +398,11 @@ class TrtConvertExpandV2Test3(TrtLayerAutoScanTest):
...
@@ -392,9 +398,11 @@ class TrtConvertExpandV2Test3(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
# fill_constant will be folded by constnt folding pass!
# fill_constant will be folded by constnt folding pass!
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
...
test/ir/inference/test_trt_convert_fill_any_like.py
浏览文件 @
242d26d4
...
@@ -167,10 +167,12 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
...
@@ -167,10 +167,12 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
...
@@ -178,10 +180,12 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
...
@@ -178,10 +180,12 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
...
...
test/ir/inference/test_trt_convert_fill_constant.py
浏览文件 @
242d26d4
...
@@ -142,10 +142,12 @@ class TrtConvertFillConstantTest(TrtLayerAutoScanTest):
...
@@ -142,10 +142,12 @@ class TrtConvertFillConstantTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_flash_multihead_matmul.py
浏览文件 @
242d26d4
...
@@ -265,17 +265,21 @@ class TrtConvertFlashMultiHeadMatmulTest(TrtLayerAutoScanTest):
...
@@ -265,17 +265,21 @@ class TrtConvertFlashMultiHeadMatmulTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-5
,
1e-5
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-3
,
1e-3
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-3
,
1e-3
)
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-5
,
1e-4
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-5
,
1e-4
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-2
,
1e-3
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
(
1e-2
,
1e-3
)
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
...
test/ir/inference/test_trt_convert_flatten.py
浏览文件 @
242d26d4
...
@@ -101,10 +101,12 @@ class TrtConvertFlattenTest_dim_2(TrtLayerAutoScanTest):
...
@@ -101,10 +101,12 @@ class TrtConvertFlattenTest_dim_2(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -112,10 +114,12 @@ class TrtConvertFlattenTest_dim_2(TrtLayerAutoScanTest):
...
@@ -112,10 +114,12 @@ class TrtConvertFlattenTest_dim_2(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -202,10 +206,12 @@ class TrtConvertFlattenTest_dim_3(TrtLayerAutoScanTest):
...
@@ -202,10 +206,12 @@ class TrtConvertFlattenTest_dim_3(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -213,10 +219,12 @@ class TrtConvertFlattenTest_dim_3(TrtLayerAutoScanTest):
...
@@ -213,10 +219,12 @@ class TrtConvertFlattenTest_dim_3(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -303,10 +311,12 @@ class TrtConvertFlattenTest_dim_4(TrtLayerAutoScanTest):
...
@@ -303,10 +311,12 @@ class TrtConvertFlattenTest_dim_4(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -314,10 +324,12 @@ class TrtConvertFlattenTest_dim_4(TrtLayerAutoScanTest):
...
@@ -314,10 +324,12 @@ class TrtConvertFlattenTest_dim_4(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -404,10 +416,12 @@ class TrtConvertFlattenTest_dim_5(TrtLayerAutoScanTest):
...
@@ -404,10 +416,12 @@ class TrtConvertFlattenTest_dim_5(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -415,10 +429,12 @@ class TrtConvertFlattenTest_dim_5(TrtLayerAutoScanTest):
...
@@ -415,10 +429,12 @@ class TrtConvertFlattenTest_dim_5(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_flatten_contiguous_range.py
浏览文件 @
242d26d4
...
@@ -130,10 +130,12 @@ class TrtConvertFlattenContiguousRangeTest(TrtLayerAutoScanTest):
...
@@ -130,10 +130,12 @@ class TrtConvertFlattenContiguousRangeTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -141,10 +143,12 @@ class TrtConvertFlattenContiguousRangeTest(TrtLayerAutoScanTest):
...
@@ -141,10 +143,12 @@ class TrtConvertFlattenContiguousRangeTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_flip.py
浏览文件 @
242d26d4
...
@@ -124,10 +124,12 @@ class TrtConvertFlipTest(TrtLayerAutoScanTest):
...
@@ -124,10 +124,12 @@ class TrtConvertFlipTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_fused_token_prune.py
浏览文件 @
242d26d4
...
@@ -121,10 +121,12 @@ class TrtConvertFusedTokenPruneTest(TrtLayerAutoScanTest):
...
@@ -121,10 +121,12 @@ class TrtConvertFusedTokenPruneTest(TrtLayerAutoScanTest):
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-2
,
1e-2
)
),
(
1e-2
,
1e-2
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-1
,
1e-2
)
),
(
1e-1
,
1e-2
)
...
...
test/ir/inference/test_trt_convert_gather.py
浏览文件 @
242d26d4
...
@@ -194,10 +194,12 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
...
@@ -194,10 +194,12 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-3
),
1e-3
...
@@ -205,8 +207,10 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
...
@@ -205,8 +207,10 @@ class TrtConvertGatherTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
...
test/ir/inference/test_trt_convert_gather_nd.py
浏览文件 @
242d26d4
...
@@ -93,15 +93,19 @@ class TrtConvertGatherNdTest_dim_4_1(TrtLayerAutoScanTest):
...
@@ -93,15 +93,19 @@ class TrtConvertGatherNdTest_dim_4_1(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -183,15 +187,19 @@ class TrtConvertGatherNdTest_dim_4_1_2(TrtLayerAutoScanTest):
...
@@ -183,15 +187,19 @@ class TrtConvertGatherNdTest_dim_4_1_2(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -273,15 +281,19 @@ class TrtConvertGatherNdTest_dim_4_2(TrtLayerAutoScanTest):
...
@@ -273,15 +281,19 @@ class TrtConvertGatherNdTest_dim_4_2(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -363,15 +375,19 @@ class TrtConvertGatherNdTest_dim_4_3(TrtLayerAutoScanTest):
...
@@ -363,15 +375,19 @@ class TrtConvertGatherNdTest_dim_4_3(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -453,15 +469,19 @@ class TrtConvertGatherNdTest_dim_2_2(TrtLayerAutoScanTest):
...
@@ -453,15 +469,19 @@ class TrtConvertGatherNdTest_dim_2_2(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -545,15 +565,19 @@ class TrtConvertGatherNdTest_dim_3_3(TrtLayerAutoScanTest):
...
@@ -545,15 +565,19 @@ class TrtConvertGatherNdTest_dim_3_3(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
yield
self
.
create_inference_config
(),
(
0
,
4
),
1e-3
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_gelu.py
浏览文件 @
242d26d4
...
@@ -127,10 +127,12 @@ class TrtConvertGeluTest(TrtLayerAutoScanTest):
...
@@ -127,10 +127,12 @@ class TrtConvertGeluTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -138,10 +140,12 @@ class TrtConvertGeluTest(TrtLayerAutoScanTest):
...
@@ -138,10 +140,12 @@ class TrtConvertGeluTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_grid_sampler.py
浏览文件 @
242d26d4
...
@@ -138,8 +138,10 @@ class TrtConvertGridSampler(TrtLayerAutoScanTest):
...
@@ -138,8 +138,10 @@ class TrtConvertGridSampler(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_group_norm.py
浏览文件 @
242d26d4
...
@@ -125,11 +125,13 @@ class TrtConvertGroupNormTest(TrtLayerAutoScanTest):
...
@@ -125,11 +125,13 @@ class TrtConvertGroupNormTest(TrtLayerAutoScanTest):
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
...
@@ -138,11 +140,13 @@ class TrtConvertGroupNormTest(TrtLayerAutoScanTest):
...
@@ -138,11 +140,13 @@ class TrtConvertGroupNormTest(TrtLayerAutoScanTest):
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
...
...
test/ir/inference/test_trt_convert_hard_sigmoid.py
浏览文件 @
242d26d4
...
@@ -97,15 +97,19 @@ class TrtConvertHardSigmoidTest_dim_2(TrtLayerAutoScanTest):
...
@@ -97,15 +97,19 @@ class TrtConvertHardSigmoidTest_dim_2(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_hard_swish.py
浏览文件 @
242d26d4
...
@@ -97,10 +97,12 @@ class TrtConvertHardSwishTest(TrtLayerAutoScanTest):
...
@@ -97,10 +97,12 @@ class TrtConvertHardSwishTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -108,10 +110,12 @@ class TrtConvertHardSwishTest(TrtLayerAutoScanTest):
...
@@ -108,10 +110,12 @@ class TrtConvertHardSwishTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_index_select.py
浏览文件 @
242d26d4
...
@@ -171,10 +171,12 @@ class TrtConvertIndexSelectTest(TrtLayerAutoScanTest):
...
@@ -171,10 +171,12 @@ class TrtConvertIndexSelectTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-3
),
1e-3
...
@@ -182,8 +184,10 @@ class TrtConvertIndexSelectTest(TrtLayerAutoScanTest):
...
@@ -182,8 +184,10 @@ class TrtConvertIndexSelectTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_instance_norm.py
浏览文件 @
242d26d4
...
@@ -145,10 +145,12 @@ class TrtConvertInstanceNormTest(TrtLayerAutoScanTest):
...
@@ -145,10 +145,12 @@ class TrtConvertInstanceNormTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -156,10 +158,12 @@ class TrtConvertInstanceNormTest(TrtLayerAutoScanTest):
...
@@ -156,10 +158,12 @@ class TrtConvertInstanceNormTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_inverse.py
浏览文件 @
242d26d4
...
@@ -82,15 +82,19 @@ class TrtConvertInverse(TrtLayerAutoScanTest):
...
@@ -82,15 +82,19 @@ class TrtConvertInverse(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
0
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
0
,
3
),
1e-3
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_layer_norm.py
浏览文件 @
242d26d4
...
@@ -125,10 +125,12 @@ class TrtConvertLayerNormTest(TrtLayerAutoScanTest):
...
@@ -125,10 +125,12 @@ class TrtConvertLayerNormTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
@@ -136,10 +138,12 @@ class TrtConvertLayerNormTest(TrtLayerAutoScanTest):
...
@@ -136,10 +138,12 @@ class TrtConvertLayerNormTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
...
@@ -249,10 +253,12 @@ class TrtConvertLayerNormTest_2(TrtLayerAutoScanTest):
...
@@ -249,10 +253,12 @@ class TrtConvertLayerNormTest_2(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
@@ -260,10 +266,12 @@ class TrtConvertLayerNormTest_2(TrtLayerAutoScanTest):
...
@@ -260,10 +266,12 @@ class TrtConvertLayerNormTest_2(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
...
...
test/ir/inference/test_trt_convert_leaky_relu.py
浏览文件 @
242d26d4
...
@@ -103,14 +103,17 @@ class TrtConvertLeakyReluTest(TrtLayerAutoScanTest):
...
@@ -103,14 +103,17 @@ class TrtConvertLeakyReluTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
program_config
.
set_input_type
(
np
.
int8
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -118,14 +121,17 @@ class TrtConvertLeakyReluTest(TrtLayerAutoScanTest):
...
@@ -118,14 +121,17 @@ class TrtConvertLeakyReluTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
program_config
.
set_input_type
(
np
.
int8
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_lookup_table.py
浏览文件 @
242d26d4
...
@@ -138,10 +138,12 @@ class TrtConvertLookupTableV2Test(TrtLayerAutoScanTest):
...
@@ -138,10 +138,12 @@ class TrtConvertLookupTableV2Test(TrtLayerAutoScanTest):
# for dynamic_shape mode
# for dynamic_shape mode
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_lookup_table_v2.py
浏览文件 @
242d26d4
...
@@ -128,10 +128,12 @@ class TrtConvertLookupTableV2Test(TrtLayerAutoScanTest):
...
@@ -128,10 +128,12 @@ class TrtConvertLookupTableV2Test(TrtLayerAutoScanTest):
# for dynamic_shape mode
# for dynamic_shape mode
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_matmul.py
浏览文件 @
242d26d4
...
@@ -101,8 +101,10 @@ class TrtConvertMatmulTest_static(TrtLayerAutoScanTest):
...
@@ -101,8 +101,10 @@ class TrtConvertMatmulTest_static(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
def
test
(
self
):
def
test
(
self
):
...
@@ -192,8 +194,10 @@ class TrtConvertMatmulTest_dynamic(TrtLayerAutoScanTest):
...
@@ -192,8 +194,10 @@ class TrtConvertMatmulTest_dynamic(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
...
test/ir/inference/test_trt_convert_matmul_v2.py
浏览文件 @
242d26d4
...
@@ -96,8 +96,10 @@ class TrtConvertMatmulTest_dynamic(TrtLayerAutoScanTest):
...
@@ -96,8 +96,10 @@ class TrtConvertMatmulTest_dynamic(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
tol_fp32
,
tol_fp32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
tol_fp32
,
tol_fp32
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
tol_half
,
tol_half
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
tol_half
,
tol_half
)
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -182,8 +184,10 @@ class TrtConvertMatmulTest_dynamic2(TrtLayerAutoScanTest):
...
@@ -182,8 +184,10 @@ class TrtConvertMatmulTest_dynamic2(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
tol_fp32
,
tol_fp32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
tol_fp32
,
tol_fp32
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
tol_half
,
tol_half
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
tol_half
,
tol_half
)
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -311,8 +315,10 @@ class TrtConvertMatmulTest_dynamic3(TrtLayerAutoScanTest):
...
@@ -311,8 +315,10 @@ class TrtConvertMatmulTest_dynamic3(TrtLayerAutoScanTest):
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
3
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
...
test/ir/inference/test_trt_convert_mish.py
浏览文件 @
242d26d4
...
@@ -139,10 +139,12 @@ class TrtConvertMishTest(TrtLayerAutoScanTest):
...
@@ -139,10 +139,12 @@ class TrtConvertMishTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -150,10 +152,12 @@ class TrtConvertMishTest(TrtLayerAutoScanTest):
...
@@ -150,10 +152,12 @@ class TrtConvertMishTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_multiclass_nms.py
浏览文件 @
242d26d4
...
@@ -160,10 +160,12 @@ class TrtConvertMulticlassNMSTest(TrtLayerAutoScanTest):
...
@@ -160,10 +160,12 @@ class TrtConvertMulticlassNMSTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
@@ -171,6 +173,7 @@ class TrtConvertMulticlassNMSTest(TrtLayerAutoScanTest):
...
@@ -171,6 +173,7 @@ class TrtConvertMulticlassNMSTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
...
...
test/ir/inference/test_trt_convert_multiclass_nms3.py
浏览文件 @
242d26d4
...
@@ -167,10 +167,12 @@ class TrtConvertMulticlassNMS3Test(TrtLayerAutoScanTest):
...
@@ -167,10 +167,12 @@ class TrtConvertMulticlassNMS3Test(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
@@ -178,6 +180,7 @@ class TrtConvertMulticlassNMS3Test(TrtLayerAutoScanTest):
...
@@ -178,6 +180,7 @@ class TrtConvertMulticlassNMS3Test(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
...
...
test/ir/inference/test_trt_convert_multihead_matmul.py
浏览文件 @
242d26d4
...
@@ -385,9 +385,11 @@ class TrtConvertMultiHeadMatmulTest(TrtLayerAutoScanTest):
...
@@ -385,9 +385,11 @@ class TrtConvertMultiHeadMatmulTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-2
,
1e-2
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-2
,
1e-2
)
def
test
(
self
):
def
test
(
self
):
...
@@ -983,16 +985,19 @@ class TrtConvertVitToMultiHeadMatmulTest(TrtLayerAutoScanTest):
...
@@ -983,16 +985,19 @@ class TrtConvertVitToMultiHeadMatmulTest(TrtLayerAutoScanTest):
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Int8
program_config
.
set_input_type
(
np
.
int8
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
1e-3
,
1e-3
,
1e-3
,
1e-3
,
)
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
1e-3
,
1e-3
,
2e-2
,
2e-2
,
)
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(),
(
1e-5
,
1e-5
,
1e-5
,
1e-5
,
...
@@ -1364,9 +1369,11 @@ class TrtConvertMultiHeadMatmulTest_biasqk_seqseq(TrtLayerAutoScanTest):
...
@@ -1364,9 +1369,11 @@ class TrtConvertMultiHeadMatmulTest_biasqk_seqseq(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-2
,
1e-2
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-2
,
1e-2
)
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_multihead_matmul_roformer.py
浏览文件 @
242d26d4
...
@@ -540,9 +540,11 @@ class TrtConvertMultiHeadMatmulRoformerTest(TrtLayerAutoScanTest):
...
@@ -540,9 +540,11 @@ class TrtConvertMultiHeadMatmulRoformerTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
yield
self
.
create_inference_config
(),
(
1
,
5
),
(
1e-3
,
1e-3
)
yield
self
.
create_inference_config
(),
(
1
,
5
),
(
1e-3
,
1e-3
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
5
),
(
1e-3
,
1e-3
)
yield
self
.
create_inference_config
(),
(
1
,
5
),
(
1e-3
,
1e-3
)
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_nearest_interp.py
浏览文件 @
242d26d4
...
@@ -113,10 +113,12 @@ class TrtConvertNearestInterpTest(TrtLayerAutoScanTest):
...
@@ -113,10 +113,12 @@ class TrtConvertNearestInterpTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
@@ -124,10 +126,12 @@ class TrtConvertNearestInterpTest(TrtLayerAutoScanTest):
...
@@ -124,10 +126,12 @@ class TrtConvertNearestInterpTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
...
...
test/ir/inference/test_trt_convert_nearest_interp_v2.py
浏览文件 @
242d26d4
...
@@ -83,10 +83,12 @@ class TrtConvertNearestInterpV2Test(TrtLayerAutoScanTest):
...
@@ -83,10 +83,12 @@ class TrtConvertNearestInterpV2Test(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
@@ -94,10 +96,12 @@ class TrtConvertNearestInterpV2Test(TrtLayerAutoScanTest):
...
@@ -94,10 +96,12 @@ class TrtConvertNearestInterpV2Test(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
...
@@ -174,10 +178,12 @@ class TrtConvertNearestInterpV2ShapeTensorTest(TrtLayerAutoScanTest):
...
@@ -174,10 +178,12 @@ class TrtConvertNearestInterpV2ShapeTensorTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
@@ -185,10 +191,12 @@ class TrtConvertNearestInterpV2ShapeTensorTest(TrtLayerAutoScanTest):
...
@@ -185,10 +191,12 @@ class TrtConvertNearestInterpV2ShapeTensorTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
...
...
test/ir/inference/test_trt_convert_one_hot.py
浏览文件 @
242d26d4
...
@@ -141,10 +141,12 @@ class TrtConvertOneHotTest(TrtLayerAutoScanTest):
...
@@ -141,10 +141,12 @@ class TrtConvertOneHotTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
...
@@ -152,10 +154,12 @@ class TrtConvertOneHotTest(TrtLayerAutoScanTest):
...
@@ -152,10 +154,12 @@ class TrtConvertOneHotTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
...
...
test/ir/inference/test_trt_convert_p_norm.py
浏览文件 @
242d26d4
...
@@ -118,10 +118,12 @@ class TrtConvertPNormTest(TrtLayerAutoScanTest):
...
@@ -118,10 +118,12 @@ class TrtConvertPNormTest(TrtLayerAutoScanTest):
# for dynamic_shape mode
# for dynamic_shape mode
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_pad.py
浏览文件 @
242d26d4
...
@@ -104,10 +104,12 @@ class TrtConvertPadTest(TrtLayerAutoScanTest):
...
@@ -104,10 +104,12 @@ class TrtConvertPadTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
@@ -115,10 +117,12 @@ class TrtConvertPadTest(TrtLayerAutoScanTest):
...
@@ -115,10 +117,12 @@ class TrtConvertPadTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
...
...
test/ir/inference/test_trt_convert_pad3d.py
浏览文件 @
242d26d4
...
@@ -120,10 +120,12 @@ class TrtConvertPad3dTensorPadding(TrtLayerAutoScanTest):
...
@@ -120,10 +120,12 @@ class TrtConvertPad3dTensorPadding(TrtLayerAutoScanTest):
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -131,10 +133,12 @@ class TrtConvertPad3dTensorPadding(TrtLayerAutoScanTest):
...
@@ -131,10 +133,12 @@ class TrtConvertPad3dTensorPadding(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
@@ -230,10 +234,12 @@ class TrtConvertPad3dListPadding(TrtLayerAutoScanTest):
...
@@ -230,10 +234,12 @@ class TrtConvertPad3dListPadding(TrtLayerAutoScanTest):
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -241,10 +247,12 @@ class TrtConvertPad3dListPadding(TrtLayerAutoScanTest):
...
@@ -241,10 +247,12 @@ class TrtConvertPad3dListPadding(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_pool2d.py
浏览文件 @
242d26d4
...
@@ -153,10 +153,12 @@ class TrtConvertPool2dTest(TrtLayerAutoScanTest):
...
@@ -153,10 +153,12 @@ class TrtConvertPool2dTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -164,10 +166,12 @@ class TrtConvertPool2dTest(TrtLayerAutoScanTest):
...
@@ -164,10 +166,12 @@ class TrtConvertPool2dTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_preln_residual_bias.py
浏览文件 @
242d26d4
...
@@ -169,10 +169,12 @@ class TrtConvertSkipLayernormTest(TrtLayerAutoScanTest):
...
@@ -169,10 +169,12 @@ class TrtConvertSkipLayernormTest(TrtLayerAutoScanTest):
# for static_shape, fall back to fluid fused op
# for static_shape, fall back to fluid fused op
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
# atol=1e-2 while rtol is 1e-8
),
1e-2
# atol=1e-2 while rtol is 1e-8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
# atol=1e-2 while rtol is 1e-8
),
1e-2
# atol=1e-2 while rtol is 1e-8
...
@@ -180,10 +182,12 @@ class TrtConvertSkipLayernormTest(TrtLayerAutoScanTest):
...
@@ -180,10 +182,12 @@ class TrtConvertSkipLayernormTest(TrtLayerAutoScanTest):
# just support dynamic_shape
# just support dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
# atol=1e-2 while rtol is 1e-8
),
1e-2
# atol=1e-2 while rtol is 1e-8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
# atol=1e-2 while rtol is 1e-8
),
1e-2
# atol=1e-2 while rtol is 1e-8
...
...
test/ir/inference/test_trt_convert_preln_residual_no_bias.py
浏览文件 @
242d26d4
...
@@ -158,10 +158,12 @@ class TrtConvertSkipLayernormTest(TrtLayerAutoScanTest):
...
@@ -158,10 +158,12 @@ class TrtConvertSkipLayernormTest(TrtLayerAutoScanTest):
# for static_shape, fall back to fluid fused op
# for static_shape, fall back to fluid fused op
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
# atol=1e-2 while rtol is 1e-8
),
1e-2
# atol=1e-2 while rtol is 1e-8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
# atol=1e-2 while rtol is 1e-8
),
1e-2
# atol=1e-2 while rtol is 1e-8
...
@@ -169,10 +171,12 @@ class TrtConvertSkipLayernormTest(TrtLayerAutoScanTest):
...
@@ -169,10 +171,12 @@ class TrtConvertSkipLayernormTest(TrtLayerAutoScanTest):
# just support dynamic_shape
# just support dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
# atol=1e-2 while rtol is 1e-8
),
1e-2
# atol=1e-2 while rtol is 1e-8
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
# atol=1e-2 while rtol is 1e-8
),
1e-2
# atol=1e-2 while rtol is 1e-8
...
...
test/ir/inference/test_trt_convert_prelu.py
浏览文件 @
242d26d4
...
@@ -205,10 +205,12 @@ class TrtConvertPreluTest(TrtLayerAutoScanTest):
...
@@ -205,10 +205,12 @@ class TrtConvertPreluTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -216,10 +218,12 @@ class TrtConvertPreluTest(TrtLayerAutoScanTest):
...
@@ -216,10 +218,12 @@ class TrtConvertPreluTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_qk_multihead_matmul.py
浏览文件 @
242d26d4
...
@@ -329,17 +329,21 @@ class TrtConvertQkAttentionTest(TrtLayerAutoScanTest):
...
@@ -329,17 +329,21 @@ class TrtConvertQkAttentionTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-3
,
1e-3
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-3
,
1e-3
)
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-4
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-5
,
1e-4
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-2
,
1e-3
)
yield
self
.
create_inference_config
(),
(
1
,
3
),
(
1e-2
,
1e-3
)
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
...
test/ir/inference/test_trt_convert_range.py
浏览文件 @
242d26d4
...
@@ -130,10 +130,12 @@ class TrtConvertRangeDynamicTest(TrtLayerAutoScanTest):
...
@@ -130,10 +130,12 @@ class TrtConvertRangeDynamicTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-2
),
1e-2
...
@@ -214,10 +216,12 @@ class TrtConvertRangeStaticTest(TrtLayerAutoScanTest):
...
@@ -214,10 +216,12 @@ class TrtConvertRangeStaticTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-2
),
1e-2
...
...
test/ir/inference/test_trt_convert_reduce.py
浏览文件 @
242d26d4
...
@@ -164,10 +164,12 @@ class TrtConvertReduceTest(TrtLayerAutoScanTest):
...
@@ -164,10 +164,12 @@ class TrtConvertReduceTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -175,10 +177,12 @@ class TrtConvertReduceTest(TrtLayerAutoScanTest):
...
@@ -175,10 +177,12 @@ class TrtConvertReduceTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-5
,
1e-5
)
),
(
1e-5
,
1e-5
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_reshape.py
浏览文件 @
242d26d4
...
@@ -172,10 +172,12 @@ class TrtConvertReshapeTest(TrtLayerAutoScanTest):
...
@@ -172,10 +172,12 @@ class TrtConvertReshapeTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -183,10 +185,12 @@ class TrtConvertReshapeTest(TrtLayerAutoScanTest):
...
@@ -183,10 +185,12 @@ class TrtConvertReshapeTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
@@ -308,8 +312,10 @@ class TrtConvertReshapeTest2(TrtLayerAutoScanTest):
...
@@ -308,8 +312,10 @@ class TrtConvertReshapeTest2(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -419,8 +425,10 @@ class TrtConvertReshapeTest3(TrtLayerAutoScanTest):
...
@@ -419,8 +425,10 @@ class TrtConvertReshapeTest3(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
@@ -509,10 +517,12 @@ class TrtConvertReshapeZeroDimsTest(TrtLayerAutoScanTest):
...
@@ -509,10 +517,12 @@ class TrtConvertReshapeZeroDimsTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_rnn.py
浏览文件 @
242d26d4
...
@@ -264,10 +264,12 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest):
...
@@ -264,10 +264,12 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
tol_fp32
),
tol_fp32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
tol_half
),
tol_half
...
...
test/ir/inference/test_trt_convert_roi_align.py
浏览文件 @
242d26d4
...
@@ -190,10 +190,12 @@ class TrtConvertRoiAlignTest(TrtLayerAutoScanTest):
...
@@ -190,10 +190,12 @@ class TrtConvertRoiAlignTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -201,10 +203,12 @@ class TrtConvertRoiAlignTest(TrtLayerAutoScanTest):
...
@@ -201,10 +203,12 @@ class TrtConvertRoiAlignTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_roll.py
浏览文件 @
242d26d4
...
@@ -107,10 +107,12 @@ class TrtConvertRollTest(TrtLayerAutoScanTest):
...
@@ -107,10 +107,12 @@ class TrtConvertRollTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -118,10 +120,12 @@ class TrtConvertRollTest(TrtLayerAutoScanTest):
...
@@ -118,10 +120,12 @@ class TrtConvertRollTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_scale.py
浏览文件 @
242d26d4
...
@@ -165,10 +165,12 @@ class TrtConvertScaleTest(TrtLayerAutoScanTest):
...
@@ -165,10 +165,12 @@ class TrtConvertScaleTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -176,10 +178,12 @@ class TrtConvertScaleTest(TrtLayerAutoScanTest):
...
@@ -176,10 +178,12 @@ class TrtConvertScaleTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_scatter_nd_add.py
浏览文件 @
242d26d4
...
@@ -102,15 +102,19 @@ class TrtConvertScatterNd(TrtLayerAutoScanTest):
...
@@ -102,15 +102,19 @@ class TrtConvertScatterNd(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
5
),
1e-5
yield
self
.
create_inference_config
(),
(
0
,
5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
5
),
1e-3
yield
self
.
create_inference_config
(),
(
0
,
5
),
1e-3
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
4
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
4
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
4
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
4
),
1e-3
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_set_value.py
浏览文件 @
242d26d4
...
@@ -154,11 +154,13 @@ class TrtConvertSetValue(TrtLayerAutoScanTest):
...
@@ -154,11 +154,13 @@ class TrtConvertSetValue(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
self
.
trt_param
.
workspace_size
=
2013265920
self
.
trt_param
.
workspace_size
=
2013265920
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-5
,
1e-4
)
),
(
1e-5
,
1e-4
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_shape.py
浏览文件 @
242d26d4
...
@@ -99,10 +99,12 @@ class TrtConvertSumTest(TrtLayerAutoScanTest):
...
@@ -99,10 +99,12 @@ class TrtConvertSumTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-3
),
1e-3
...
@@ -110,8 +112,10 @@ class TrtConvertSumTest(TrtLayerAutoScanTest):
...
@@ -110,8 +112,10 @@ class TrtConvertSumTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_shuffle_channel.py
浏览文件 @
242d26d4
...
@@ -92,10 +92,12 @@ class TrtConvertShuffleChannelTest(TrtLayerAutoScanTest):
...
@@ -92,10 +92,12 @@ class TrtConvertShuffleChannelTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -103,10 +105,12 @@ class TrtConvertShuffleChannelTest(TrtLayerAutoScanTest):
...
@@ -103,10 +105,12 @@ class TrtConvertShuffleChannelTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_slice.py
浏览文件 @
242d26d4
...
@@ -131,10 +131,12 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest):
...
@@ -131,10 +131,12 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -142,10 +144,12 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest):
...
@@ -142,10 +144,12 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_softmax.py
浏览文件 @
242d26d4
...
@@ -135,10 +135,12 @@ class TrtConvertSoftmaxTest(TrtLayerAutoScanTest):
...
@@ -135,10 +135,12 @@ class TrtConvertSoftmaxTest(TrtLayerAutoScanTest):
pass
pass
else
:
else
:
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -146,10 +148,12 @@ class TrtConvertSoftmaxTest(TrtLayerAutoScanTest):
...
@@ -146,10 +148,12 @@ class TrtConvertSoftmaxTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_split.py
浏览文件 @
242d26d4
...
@@ -250,10 +250,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
...
@@ -250,10 +250,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -261,10 +263,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
...
@@ -261,10 +263,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
@@ -400,10 +404,12 @@ class TrtConvertSplitTest2(TrtLayerAutoScanTest):
...
@@ -400,10 +404,12 @@ class TrtConvertSplitTest2(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_square.py
浏览文件 @
242d26d4
...
@@ -117,10 +117,12 @@ class TrtConvertSquareTest(TrtLayerAutoScanTest):
...
@@ -117,10 +117,12 @@ class TrtConvertSquareTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -128,10 +130,12 @@ class TrtConvertSquareTest(TrtLayerAutoScanTest):
...
@@ -128,10 +130,12 @@ class TrtConvertSquareTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_squeeze2.py
浏览文件 @
242d26d4
...
@@ -117,10 +117,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
...
@@ -117,10 +117,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -128,10 +130,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
...
@@ -128,10 +130,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_stack.py
浏览文件 @
242d26d4
...
@@ -218,10 +218,12 @@ class TrtConvertStackTest(TrtLayerAutoScanTest):
...
@@ -218,10 +218,12 @@ class TrtConvertStackTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -229,10 +231,12 @@ class TrtConvertStackTest(TrtLayerAutoScanTest):
...
@@ -229,10 +231,12 @@ class TrtConvertStackTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_strided_slice.py
浏览文件 @
242d26d4
...
@@ -122,6 +122,7 @@ class TrtConvertStridedSliceTest(TrtLayerAutoScanTest):
...
@@ -122,6 +122,7 @@ class TrtConvertStridedSliceTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
...
@@ -129,6 +130,7 @@ class TrtConvertStridedSliceTest(TrtLayerAutoScanTest):
...
@@ -129,6 +130,7 @@ class TrtConvertStridedSliceTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
...
@@ -217,11 +219,13 @@ class TrtConvertStridedSliceTest2(TrtLayerAutoScanTest):
...
@@ -217,11 +219,13 @@ class TrtConvertStridedSliceTest2(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_sum.py
浏览文件 @
242d26d4
...
@@ -193,10 +193,12 @@ class TrtConvertSumTest(TrtLayerAutoScanTest):
...
@@ -193,10 +193,12 @@ class TrtConvertSumTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-3
),
1e-3
...
@@ -204,8 +206,10 @@ class TrtConvertSumTest(TrtLayerAutoScanTest):
...
@@ -204,8 +206,10 @@ class TrtConvertSumTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
def
test
(
self
):
def
test
(
self
):
...
@@ -311,10 +315,12 @@ class TrtConvertSumTest1(TrtLayerAutoScanTest):
...
@@ -311,10 +315,12 @@ class TrtConvertSumTest1(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-3
),
1e-3
...
@@ -322,8 +328,10 @@ class TrtConvertSumTest1(TrtLayerAutoScanTest):
...
@@ -322,8 +328,10 @@ class TrtConvertSumTest1(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
()
generate_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_swish.py
浏览文件 @
242d26d4
...
@@ -121,10 +121,12 @@ class TrtConvertSwishTest(TrtLayerAutoScanTest):
...
@@ -121,10 +121,12 @@ class TrtConvertSwishTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -132,10 +134,12 @@ class TrtConvertSwishTest(TrtLayerAutoScanTest):
...
@@ -132,10 +134,12 @@ class TrtConvertSwishTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_take_along_axis.py
浏览文件 @
242d26d4
...
@@ -160,10 +160,12 @@ class TrtConvertTakeAlongAxisTest(TrtLayerAutoScanTest):
...
@@ -160,10 +160,12 @@ class TrtConvertTakeAlongAxisTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
False
False
),
1e-5
),
1e-5
...
@@ -171,8 +173,10 @@ class TrtConvertTakeAlongAxisTest(TrtLayerAutoScanTest):
...
@@ -171,8 +173,10 @@ class TrtConvertTakeAlongAxisTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
True
),
1e-3
def
add_skip_trt_case
(
self
):
def
add_skip_trt_case
(
self
):
...
...
test/ir/inference/test_trt_convert_temporal_shift.py
浏览文件 @
242d26d4
...
@@ -108,10 +108,12 @@ class TrtConvertTemporalShiftTest(TrtLayerAutoScanTest):
...
@@ -108,10 +108,12 @@ class TrtConvertTemporalShiftTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -119,10 +121,12 @@ class TrtConvertTemporalShiftTest(TrtLayerAutoScanTest):
...
@@ -119,10 +121,12 @@ class TrtConvertTemporalShiftTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_tile.py
浏览文件 @
242d26d4
...
@@ -93,10 +93,12 @@ class TrtConvertTileTest(TrtLayerAutoScanTest):
...
@@ -93,10 +93,12 @@ class TrtConvertTileTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -104,10 +106,12 @@ class TrtConvertTileTest(TrtLayerAutoScanTest):
...
@@ -104,10 +106,12 @@ class TrtConvertTileTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
@@ -184,10 +188,12 @@ class TrtConvertTileTest2(TrtLayerAutoScanTest):
...
@@ -184,10 +188,12 @@ class TrtConvertTileTest2(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
@@ -283,10 +289,12 @@ class TrtConvertTileTest3(TrtLayerAutoScanTest):
...
@@ -283,10 +289,12 @@ class TrtConvertTileTest3(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_top_k.py
浏览文件 @
242d26d4
...
@@ -118,10 +118,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
...
@@ -118,10 +118,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -129,10 +131,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
...
@@ -129,10 +131,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_top_k_v2.py
浏览文件 @
242d26d4
...
@@ -147,10 +147,12 @@ class TrtConvertTopKV2Test(TrtLayerAutoScanTest):
...
@@ -147,10 +147,12 @@ class TrtConvertTopKV2Test(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -158,10 +160,12 @@ class TrtConvertTopKV2Test(TrtLayerAutoScanTest):
...
@@ -158,10 +160,12 @@ class TrtConvertTopKV2Test(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_trans_layernorm.py
浏览文件 @
242d26d4
...
@@ -226,10 +226,12 @@ class TrtConvertTransLayernormTest(TrtLayerAutoScanTest):
...
@@ -226,10 +226,12 @@ class TrtConvertTransLayernormTest(TrtLayerAutoScanTest):
# just support dynamic_shape
# just support dynamic_shape
generate_dynamic_shape
(
attrs
,
inputs
)
generate_dynamic_shape
(
attrs
,
inputs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
),
(
...
...
test/ir/inference/test_trt_convert_transpose.py
浏览文件 @
242d26d4
...
@@ -139,10 +139,12 @@ class TrtConvertTransposeTest(TrtLayerAutoScanTest):
...
@@ -139,10 +139,12 @@ class TrtConvertTransposeTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -150,10 +152,12 @@ class TrtConvertTransposeTest(TrtLayerAutoScanTest):
...
@@ -150,10 +152,12 @@ class TrtConvertTransposeTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_unary.py
浏览文件 @
242d26d4
...
@@ -208,10 +208,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
...
@@ -208,10 +208,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-4
),
1e-4
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -219,10 +221,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
...
@@ -219,10 +221,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-4
),
1e-4
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
@@ -342,10 +346,12 @@ class TrtConvertLogicalNotTest(TrtLayerAutoScanTest):
...
@@ -342,10 +346,12 @@ class TrtConvertLogicalNotTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
@@ -353,10 +359,12 @@ class TrtConvertLogicalNotTest(TrtLayerAutoScanTest):
...
@@ -353,10 +359,12 @@ class TrtConvertLogicalNotTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
(
1e-3
,
1e-3
)
),
(
1e-3
,
1e-3
)
...
...
test/ir/inference/test_trt_convert_unbind.py
浏览文件 @
242d26d4
...
@@ -106,10 +106,12 @@ class TrtConvertUnbind(TrtLayerAutoScanTest):
...
@@ -106,10 +106,12 @@ class TrtConvertUnbind(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_unfold.py
浏览文件 @
242d26d4
...
@@ -87,15 +87,19 @@ class TrtConvertUnfold(TrtLayerAutoScanTest):
...
@@ -87,15 +87,19 @@ class TrtConvertUnfold(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
0
,
3
),
1e-5
yield
self
.
create_inference_config
(),
(
0
,
3
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
0
,
3
),
1e-3
yield
self
.
create_inference_config
(),
(
0
,
3
),
1e-3
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
yield
self
.
create_inference_config
(),
(
1
,
2
),
1e-3
def
test
(
self
):
def
test
(
self
):
...
...
test/ir/inference/test_trt_convert_unsqueeze2.py
浏览文件 @
242d26d4
...
@@ -100,10 +100,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
...
@@ -100,10 +100,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -111,10 +113,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
...
@@ -111,10 +113,12 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_where.py
浏览文件 @
242d26d4
...
@@ -206,10 +206,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
...
@@ -206,10 +206,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
...
@@ -217,10 +219,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
...
@@ -217,10 +219,12 @@ class TrtConvertActivationTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
...
...
test/ir/inference/test_trt_convert_yolo_box.py
浏览文件 @
242d26d4
...
@@ -153,10 +153,12 @@ class TrtConvertYoloBoxTest(TrtLayerAutoScanTest):
...
@@ -153,10 +153,12 @@ class TrtConvertYoloBoxTest(TrtLayerAutoScanTest):
# for static_shape
# for static_shape
clear_dynamic_shape
()
clear_dynamic_shape
()
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
False
attrs
,
False
),
1e-3
),
1e-3
...
@@ -164,10 +166,12 @@ class TrtConvertYoloBoxTest(TrtLayerAutoScanTest):
...
@@ -164,10 +166,12 @@ class TrtConvertYoloBoxTest(TrtLayerAutoScanTest):
# for dynamic_shape
# for dynamic_shape
generate_dynamic_shape
(
attrs
)
generate_dynamic_shape
(
attrs
)
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-5
),
1e-5
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Half
program_config
.
set_input_type
(
np
.
float16
)
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
yield
self
.
create_inference_config
(),
generate_trt_nodes_num
(
attrs
,
True
attrs
,
True
),
1e-3
),
1e-3
...
...
test/ir/inference/test_trt_convert_yolo_box_head.py
浏览文件 @
242d26d4
...
@@ -79,6 +79,7 @@ class TrtConvertYoloBoxHeadTest(TrtLayerAutoScanTest):
...
@@ -79,6 +79,7 @@ class TrtConvertYoloBoxHeadTest(TrtLayerAutoScanTest):
)
->
(
paddle_infer
.
Config
,
List
[
int
],
float
):
)
->
(
paddle_infer
.
Config
,
List
[
int
],
float
):
# for static_shape
# for static_shape
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
self
.
trt_param
.
precision
=
paddle_infer
.
PrecisionType
.
Float32
program_config
.
set_input_type
(
np
.
float32
)
yield
self
.
create_inference_config
(),
[
1
,
2
],
1e-5
yield
self
.
create_inference_config
(),
[
1
,
2
],
1e-5
def
test
(
self
):
def
test
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录