From 0cef07eca8c91738093df86903f3584daaf12b9a Mon Sep 17 00:00:00 2001 From: TatWai Chong Date: Mon, 27 Feb 2023 13:22:52 -0800 Subject: Refactor resize test builder Also add input size = 1 in the shape list, and extend scaling to 1x, 2x and 3x, so that the cases of broadcasting, power-of-two scaling, no-scaling (e.g. 1x1 -> 1x1), scaling accuracy (3x) can be tested. Since the scalar tensor is tiny, should not noticeably impact the execution time of the framework test. Change-Id: Iec53da3cbb60e087077d6e2d8eb205e76e6c1313 Signed-off-by: TatWai Chong --- verif/frameworks/arg_gen.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'verif/frameworks/arg_gen.py') diff --git a/verif/frameworks/arg_gen.py b/verif/frameworks/arg_gen.py index 18e8976..8604f0b 100644 --- a/verif/frameworks/arg_gen.py +++ b/verif/frameworks/arg_gen.py @@ -587,6 +587,30 @@ class ArgGen: ) return arg_list + def agResize(op, shapes, rng): + args = [] + for mode in ["nearest", "bilinear"]: + for align_corners in [True, False]: + for half_pixel in [True, False]: + # If half_pixel_centers is True, align_corners must be False. + if ( + (mode == "bilinear") + and (align_corners is True) + and (half_pixel is True) + ): + continue + + for i in range(1, 4): + args.append( + [ + "_{}_align{}_half{}_scale{}".format( + mode, int(align_corners), int(half_pixel), i + ), + [mode, align_corners, half_pixel, i], + ] + ) + return args + def agFill(op, shapes, rng): values = [] for i in range(4): -- cgit v1.2.1