diff options
author | Andreas Nevalainen <andreas.nevalainen@arm.com> | 2020-09-24 13:43:00 +0200 |
---|---|---|
committer | Andreas Nevalainen <andreas.nevalainen@arm.com> | 2020-09-24 13:48:01 +0200 |
commit | 8854dc9088586e1bb0bf2640b2289903dfa3c822 (patch) | |
tree | c7a09788b7cb89f4e28835fc95ded6a8cf3a1cd8 /ethosu/vela/supported_operators.py | |
parent | 6c97e9a689736febf76c739c6b677d1b253048e5 (diff) | |
download | ethos-u-vela-8854dc9088586e1bb0bf2640b2289903dfa3c822.tar.gz |
MLBEDSW-2788 Fix crash on non-constant weight tensors
Change-Id: I750ec63a0e37b38feaf4cbdcc883fdbef92bccdf
Signed-off-by: Andreas Nevalainen <andreas.nevalainen@arm.com>
Diffstat (limited to 'ethosu/vela/supported_operators.py')
-rw-r--r-- | ethosu/vela/supported_operators.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ethosu/vela/supported_operators.py b/ethosu/vela/supported_operators.py index b0afa2c9..63eb01b5 100644 --- a/ethosu/vela/supported_operators.py +++ b/ethosu/vela/supported_operators.py @@ -215,6 +215,11 @@ class SupportedOperators: if dilated_weight_w > 64 or dilated_weight_h > 64: return False + # check non const weights + if weight_tensor.values is None: + print("Warning:", op.type, "has non-const weights, placing on CPU") + return False + # check weight sums over [HWI] zero_point = weight_tensor.quantization.zero_point quant_weights = weight_tensor.quant_values.astype(np.int64) @@ -228,11 +233,6 @@ class SupportedOperators: if ifm_tensor.shape[0] != 1: return False - # check non const weights - if weight_tensor.values is None: - print("Warning:", op.type, "has non-const weights, placing on CPU") - return False - return True def check_depthwise_convolution_restrictions(self, op): |