From 69b3176127ff8522903e087d56e2d2f4ec557d62 Mon Sep 17 00:00:00 2001 From: Louis Verhaard Date: Tue, 17 Nov 2020 09:45:20 +0100 Subject: 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 Change-Id: I1b64b117f8236ce9ba321ca03bdb25e5a03a6589 --- ethosu/vela/numeric_util.py | 1 + 1 file changed, 1 insertion(+) (limited to 'ethosu/vela/numeric_util.py') 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 -- cgit v1.2.1