diff options
author | Eric Kunze <eric.kunze@arm.com> | 2022-01-04 10:07:29 -0800 |
---|---|---|
committer | Eric Kunze <eric.kunze@arm.com> | 2022-01-05 08:11:22 -0800 |
commit | a1d49853082f5454144209c1d95dc9203f510746 (patch) | |
tree | 1dd1ce92b62fa37823d2c5988768e94cc4b8cbe0 | |
parent | f20a5a48d1df6b4d9c6da38533f77af5591e939e (diff) | |
download | reference_model-a1d49853082f5454144209c1d95dc9203f510746.tar.gz |
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>
-rw-r--r-- | verif/tosa_test_gen.py | 4 |
1 files 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]) |