From ac8c0c83e52e0408191787e16b2b3bca1baf3ce7 Mon Sep 17 00:00:00 2001 From: Jeremy Johnson Date: Thu, 21 Mar 2024 10:32:26 +0000 Subject: Reduce WrongRank tests to the minimum needed Signed-off-by: Jeremy Johnson Change-Id: Ideeb67ec4b33b9c6922d6765f4b0eb5ca69bdf89 --- verif/generator/tosa_error_if.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/verif/generator/tosa_error_if.py b/verif/generator/tosa_error_if.py index 1b6b044..53a3199 100644 --- a/verif/generator/tosa_error_if.py +++ b/verif/generator/tosa_error_if.py @@ -680,14 +680,13 @@ class TosaErrorValidator: @staticmethod def evWrongRank(check=False, **kwargs): - # From 1 to MAX_TENSOR_RANK+1 inclusively - all_ranks = tuple(range(1, gtu.MAX_TENSOR_RANK + 2)) - # Make a list of incorrect ranks assert "op" in kwargs op = kwargs["op"] rmin, rmax = op["rank"] rank_range = range(rmin, rmax + 1) + # From 1 to rmax+1 inclusively + all_ranks = tuple(range(1, rmax + 2)) incorrect_ranks = list(set(all_ranks) - set(rank_range)) # Remove small incorrect ranks to avoid index errors incorrect_ranks = [rank for rank in incorrect_ranks if rank > rmin] -- cgit v1.2.1