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 <eric.kunze@arm.com>
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 @@
# 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])