aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Alfven <johan.alfven@arm.com>2023-05-02 10:58:26 +0200
committerJohan Alfven <johan.alfven@arm.com>2023-05-02 15:46:00 +0200
commitda67f51c64b1193fe62bc97950c789670c4dd17d (patch)
tree95715c7fff66c20974dbf65200d4f4d026bb4fba
parentce5027328d2330d33bdfc5d5b016d171e4f8a2fc (diff)
downloadethos-u-vela-da67f51c64b1193fe62bc97950c789670c4dd17d.tar.gz
MLBEDSW-7545: Fix assert when serializing a tensor
- The assert triggers when a constant tensor is being assigned to buffer 0 and that is a violation. - The test case that triggered this problem revealed an error in the reader code. If the input tensor has constant data it should be using a Const op. Before this fix it was assigned a Placeholder op and the tensor ended up in the scratch area instead of the permanent area. Change-Id: I4f92fb5ec1f0dc594defbaca0335eabe68fd5137 Signed-off-by: Johan Alfven <johan.alfven@arm.com>
-rw-r--r--ethosu/vela/reader_util.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ethosu/vela/reader_util.py b/ethosu/vela/reader_util.py
index d30a7bb3..6d2439c9 100644
--- a/ethosu/vela/reader_util.py
+++ b/ethosu/vela/reader_util.py
@@ -51,7 +51,7 @@ def fixup_tensors(input_tensors, tensors):
if tens.ops != []:
tens.error("This subgraph input tensor has unexpected driving operators.")
- op = Operation(Op.Placeholder, tens.name)
+ op = Operation(Op.Placeholder if tens.values is None else Op.Const, tens.name)
op.set_output_tensor(tens)
for tens in tensors: