From 0411edb8947bc2993b1f9498ef43d5b40a2a6305 Mon Sep 17 00:00:00 2001 From: Louis Verhaard Date: Mon, 16 Nov 2020 16:37:11 +0100 Subject: MLBEDSW-3493: bug fixes in mark_tensors None inputs and unsupported tensor shapes caused asserts when marking tensor purpose/format. Change-Id: I4498b61576f529c1a594341cfbb6ba278c6e7ec5 Signed-off-by: Louis Verhaard --- ethosu/vela/mark_tensors.py | 2 ++ ethosu/vela/tensor.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ethosu/vela/mark_tensors.py b/ethosu/vela/mark_tensors.py index 1379628a..723bd876 100644 --- a/ethosu/vela/mark_tensors.py +++ b/ethosu/vela/mark_tensors.py @@ -59,6 +59,8 @@ def rewrite_mark_tensor_purpose(op, arch): mark_purpose(tens, arch, TensorPurpose.FeatureMap) weight_tensors = op.get_weight_tensors() for tens in op.inputs: + if tens is None: + continue if tens.purpose != TensorPurpose.Unknown: purpose = tens.purpose elif tens in weight_tensors: diff --git a/ethosu/vela/tensor.py b/ethosu/vela/tensor.py index 45518b4e..0d299e15 100644 --- a/ethosu/vela/tensor.py +++ b/ethosu/vela/tensor.py @@ -446,6 +446,8 @@ class Tensor: except TypeError: pass + if shape_len > 4: + return self.storage_rounding_quantum = arch.storage_rounding_quantums[self.format] self.storage_rounding_quantum = self.storage_rounding_quantum[-shape_len:] self.brick_size = arch.brick_sizes[self.format] -- cgit v1.2.1