aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/numeric_util.py
diff options
context:
space:
mode:
authorLouis Verhaard <louis.verhaard@arm.com>2020-11-17 09:45:20 +0100
committerLouis Verhaard <louis.verhaard@arm.com>2020-11-17 14:30:52 +0100
commit69b3176127ff8522903e087d56e2d2f4ec557d62 (patch)
treeeafccbe6d44fe7b73e657cc462d8770da69ea0a2 /ethosu/vela/numeric_util.py
parent0411edb8947bc2993b1f9498ef43d5b40a2a6305 (diff)
downloadethos-u-vela-69b3176127ff8522903e087d56e2d2f4ec557d62.tar.gz
MLBEDSW-3491: Fix index out of range in code gen
Usage of shape[-2] could cause index out of range. Signed-off-by: Louis Verhaard <louis.verhaard@arm.com> Change-Id: I1b64b117f8236ce9ba321ca03bdb25e5a03a6589
Diffstat (limited to 'ethosu/vela/numeric_util.py')
-rw-r--r--ethosu/vela/numeric_util.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/ethosu/vela/numeric_util.py b/ethosu/vela/numeric_util.py
index 20aa4a05..d596209a 100644
--- a/ethosu/vela/numeric_util.py
+++ b/ethosu/vela/numeric_util.py
@@ -88,6 +88,7 @@ def clamp_sigmoid(x):
def full_shape(dim, shape, fill):
+ """Returns a shape of at least dim dimensions"""
return ([fill] * (dim - len(shape))) + shape