aboutsummaryrefslogtreecommitdiff
path: root/verif/frameworks/arg_gen.py
diff options
context:
space:
mode:
authorTatWai Chong <tatwai.chong@arm.com>2023-02-27 13:22:52 -0800
committerTatWai Chong <tatwai.chong@arm.com>2023-03-03 15:15:38 -0800
commit0cef07eca8c91738093df86903f3584daaf12b9a (patch)
tree6b849112ffc3657dc69ef02a4248fd0b729566e6 /verif/frameworks/arg_gen.py
parent57bc0796cd85115684219cf373db04c172848306 (diff)
downloadreference_model-0cef07eca8c91738093df86903f3584daaf12b9a.tar.gz
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 <tatwai.chong@arm.com>
Diffstat (limited to 'verif/frameworks/arg_gen.py')
-rw-r--r--verif/frameworks/arg_gen.py24
1 files changed, 24 insertions, 0 deletions
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):