From 4528ed2a4abe5ec8fae315a37ee3f2c116c1b839 Mon Sep 17 00:00:00 2001 From: HongyuJia Date: Fri, 19 Aug 2022 16:15:37 +0800 Subject: [PATCH] =?UTF-8?q?polish=20default=20param=20of=20XXX=5Finterp=5F?= =?UTF-8?q?test,=20the=20same=20default=20value=20with=20=E2=80=A6=20(#452?= =?UTF-8?q?58)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * polish default param of XXX_interp_test, the same default value with XXX_interp_np * set default value data_layout=NCHW, cause C++ end treat NCDHW the same way as NCHW --- .../fluid/tests/unittests/test_bicubic_interp_v2_op.py | 8 ++++---- .../fluid/tests/unittests/test_bilinear_interp_v2_op.py | 6 +++--- .../fluid/tests/unittests/test_linear_interp_v2_op.py | 4 ++-- .../fluid/tests/unittests/test_nearest_interp_v2_op.py | 6 +++--- .../fluid/tests/unittests/test_trilinear_interp_v2_op.py | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/python/paddle/fluid/tests/unittests/test_bicubic_interp_v2_op.py b/python/paddle/fluid/tests/unittests/test_bicubic_interp_v2_op.py index ed581eb724f..98560742135 100644 --- a/python/paddle/fluid/tests/unittests/test_bicubic_interp_v2_op.py +++ b/python/paddle/fluid/tests/unittests/test_bicubic_interp_v2_op.py @@ -29,14 +29,14 @@ def bicubic_interp_test(x, OutSize=None, SizeTensor=None, Scale=None, - data_layout='NCHW', + data_layout='kNCHW', out_d=-1, out_h=-1, out_w=-1, scale=[], - interp_method='linear', - align_corners=False, - align_mode=1): + interp_method='bicubic', + align_corners=True, + align_mode=0): if isinstance(scale, float) or isinstance(scale, int): scale_list = [] for _ in range(len(x.shape) - 2): diff --git a/python/paddle/fluid/tests/unittests/test_bilinear_interp_v2_op.py b/python/paddle/fluid/tests/unittests/test_bilinear_interp_v2_op.py index 06c3db0e79d..9ef3a508fc3 100755 --- a/python/paddle/fluid/tests/unittests/test_bilinear_interp_v2_op.py +++ b/python/paddle/fluid/tests/unittests/test_bilinear_interp_v2_op.py @@ -32,9 +32,9 @@ def bilinear_interp_test(x, out_h=-1, out_w=-1, scale=[], - interp_method='linear', - align_corners=False, - align_mode=1): + interp_method='bilinear', + align_corners=True, + align_mode=0): if isinstance(scale, float) or isinstance(scale, int): scale_list = [] for _ in range(len(x.shape) - 2): diff --git a/python/paddle/fluid/tests/unittests/test_linear_interp_v2_op.py b/python/paddle/fluid/tests/unittests/test_linear_interp_v2_op.py index 6782820070c..ed6b833956b 100755 --- a/python/paddle/fluid/tests/unittests/test_linear_interp_v2_op.py +++ b/python/paddle/fluid/tests/unittests/test_linear_interp_v2_op.py @@ -34,8 +34,8 @@ def linear_interp_test(x, out_w=-1, scale=[], interp_method='linear', - align_corners=False, - align_mode=1): + align_corners=True, + align_mode=0): if isinstance(scale, float) or isinstance(scale, int): scale_list = [] for _ in range(len(x.shape) - 2): diff --git a/python/paddle/fluid/tests/unittests/test_nearest_interp_v2_op.py b/python/paddle/fluid/tests/unittests/test_nearest_interp_v2_op.py index d2735eaf4b4..ae58a7fe900 100755 --- a/python/paddle/fluid/tests/unittests/test_nearest_interp_v2_op.py +++ b/python/paddle/fluid/tests/unittests/test_nearest_interp_v2_op.py @@ -35,9 +35,9 @@ def nearest_interp_test(x, out_h=-1, out_w=-1, scale=[], - interp_method='linear', - align_corners=False, - align_mode=1): + interp_method='nearest', + align_corners=True, + align_mode=0): if isinstance(scale, float) or isinstance(scale, int): scale_list = [] for _ in range(len(x.shape) - 2): diff --git a/python/paddle/fluid/tests/unittests/test_trilinear_interp_v2_op.py b/python/paddle/fluid/tests/unittests/test_trilinear_interp_v2_op.py index b0bb25319fd..6aace168ec5 100755 --- a/python/paddle/fluid/tests/unittests/test_trilinear_interp_v2_op.py +++ b/python/paddle/fluid/tests/unittests/test_trilinear_interp_v2_op.py @@ -35,9 +35,9 @@ def trilinear_interp_test(x, out_h=-1, out_w=-1, scale=[], - interp_method='linear', - align_corners=False, - align_mode=1): + interp_method='trilinear', + align_corners=True, + align_mode=0): if isinstance(scale, float) or isinstance(scale, int): scale_list = [] for _ in range(len(x.shape) - 2): -- GitLab