From 0af0d383925968626a7c37b084ad806742511e79 Mon Sep 17 00:00:00 2001 From: Alex Matthews Date: Wed, 25 Aug 2021 17:56:30 +0100 Subject: MLBEDSW-4704: Vela crashes when serializing subset of Inception v3 network * Add check for tensor with no operations, raising error if its constant-data buffer is empty Signed-off-by: Alex Matthews Change-Id: Ib210dcc9733e4ecedbada0f430e8b3c4a8384999 Signed-off-by: James Ward --- ethosu/vela/reader_util.py | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 ethosu/vela/reader_util.py (limited to 'ethosu/vela') diff --git a/ethosu/vela/reader_util.py b/ethosu/vela/reader_util.py old mode 100644 new mode 100755 index 476b70aa..b5de8b18 --- a/ethosu/vela/reader_util.py +++ b/ethosu/vela/reader_util.py @@ -53,6 +53,11 @@ def fixup_tensors(input_tensors, tensors): for tens in tensors: if not tens.ops: + if tens.values is None: + tens.error( + "Tensor with no operator output connection is assumed to contain constant " + "data but no data buffer is associated with this tensor. Perhaps the network is invalid?" + ) op = Operation(Op.Const, tens.name) op.set_output_tensor(tens) -- cgit v1.2.1