From 258ebbaee96fb24543bde99c3e48ae69d9d5486f Mon Sep 17 00:00:00 2001 From: Jacob Bohlin Date: Mon, 31 Aug 2020 10:44:35 +0200 Subject: MLBEDSW-2915: Added None check for bias before checking restrictions Signed-off-by: Jacob Bohlin Change-Id: I04618fd0d29075e7d3f8f27a320129603f045163 --- ethosu/vela/supported_operators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ethosu/vela/supported_operators.py') diff --git a/ethosu/vela/supported_operators.py b/ethosu/vela/supported_operators.py index 591f0801..7cff0ee4 100644 --- a/ethosu/vela/supported_operators.py +++ b/ethosu/vela/supported_operators.py @@ -416,11 +416,11 @@ class SupportedOperators: def check_bias_restrictions(self, bias_tensor): # check data type - if bias_tensor.dtype not in (DataType.int32, DataType.int64): + if bias_tensor is not None and bias_tensor.dtype not in (DataType.int32, DataType.int64): return False # check if values fits in 40-bit - if bias_tensor.dtype == DataType.int64: + if bias_tensor is not None and bias_tensor.dtype == DataType.int64: for quant_value in bias_tensor.quant_values: if not (-(1 << 39) <= quant_value < (1 << 39)): return False -- cgit v1.2.1