From a1d49853082f5454144209c1d95dc9203f510746 Mon Sep 17 00:00:00 2001 From: Eric Kunze Date: Tue, 4 Jan 2022 10:07:29 -0800 Subject: Fix crash with rank mismatch negative tests When testing rank mismatch tests, could be accessing beyond the end a tensor's shape. Change-Id: I304463e50579d574d629abd13098017a26a1406b Signed-off-by: Eric Kunze --- verif/tosa_test_gen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/verif/tosa_test_gen.py b/verif/tosa_test_gen.py index 0071b9f..0d29704 100644 --- a/verif/tosa_test_gen.py +++ b/verif/tosa_test_gen.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright (c) 2020-2021, ARM Limited. +# Copyright (c) 2020-2022, ARM Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -6331,7 +6331,7 @@ class OutputShaper: # Do broadcast shape = [] for i in range(len(a.shape)): - if a.shape[i] == 1: + if a.shape[i] == 1 and len(b.shape) > i: shape.append(b.shape[i]) else: shape.append(a.shape[i]) -- cgit v1.2.1