未验证 提交 d53bd8c1 编写于 作者: Z zlsh80826 提交者: GitHub

Loose TRT half test tolerance to 1e-3 (#47106)

上级 3f40cdfb
......@@ -149,7 +149,7 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -158,7 +158,7 @@ class TrtConvertExpandV2Test(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def add_skip_trt_case(self):
pass
......@@ -251,7 +251,7 @@ class TrtConvertExpandV2Test2(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 3), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (1, 3), 1e-5
yield self.create_inference_config(), (1, 3), 1e-3
def add_skip_trt_case(self):
pass
......@@ -402,7 +402,7 @@ class TrtConvertExpandV2Test3(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (4, 3), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (4, 3), 1e-5
yield self.create_inference_config(), (4, 3), 1e-3
def add_skip_trt_case(self):
pass
......
......@@ -123,7 +123,7 @@ class TrtConvertReduceSumTest(TrtLayerAutoScanTest):
attrs, False), (1e-5, 1e-5)
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), (1e-4, 1e-4)
attrs, False), (1e-3, 1e-3)
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -132,7 +132,7 @@ class TrtConvertReduceSumTest(TrtLayerAutoScanTest):
attrs, True), (1e-5, 1e-5)
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), (1e-4, 1e-4)
attrs, True), (1e-3, 1e-3)
def add_skip_trt_case(self):
pass
......
......@@ -164,7 +164,7 @@ class TrtConvertReshapeTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -173,7 +173,7 @@ class TrtConvertReshapeTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def add_skip_trt_case(self):
pass
......@@ -297,7 +297,7 @@ class TrtConvertReshapeTest2(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 2), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (1, 2), 1e-5
yield self.create_inference_config(), (1, 2), 1e-3
def add_skip_trt_case(self):
pass
......@@ -409,7 +409,7 @@ class TrtConvertReshapeTest3(TrtLayerAutoScanTest):
self.trt_param.precision = paddle_infer.PrecisionType.Float32
yield self.create_inference_config(), (1, 2), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), (1, 2), 1e-5
yield self.create_inference_config(), (1, 2), 1e-3
def add_skip_trt_case(self):
pass
......
......@@ -106,7 +106,7 @@ class TrtConvertRollTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-4
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -115,7 +115,7 @@ class TrtConvertRollTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-4
attrs, True), 1e-3
def test(self):
self.run_test()
......
......@@ -128,7 +128,7 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-4
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -137,7 +137,7 @@ class TrtConvertSliceTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-4
attrs, True), 1e-3
def test(self):
# TODO(inference): fix.
......
......@@ -219,7 +219,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -228,7 +228,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def add_skip_trt_case(self):
......
......@@ -115,7 +115,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-5
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -124,7 +124,7 @@ class TrtConvertSplitTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-5
attrs, True), 1e-3
def add_skip_trt_case(self):
pass
......
......@@ -101,7 +101,7 @@ class TrtConvertTileTest(TrtLayerAutoScanTest):
attrs, False), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, False), 1e-4
attrs, False), 1e-3
# for dynamic_shape
generate_dynamic_shape(attrs)
......@@ -110,7 +110,7 @@ class TrtConvertTileTest(TrtLayerAutoScanTest):
attrs, True), 1e-5
self.trt_param.precision = paddle_infer.PrecisionType.Half
yield self.create_inference_config(), generate_trt_nodes_num(
attrs, True), 1e-4
attrs, True), 1e-3
@given(repeat_times=st.sampled_from([[100], [1, 2], [0, 3], [1, 2, 100]]))
def test(self, *args, **kwargs):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册