From 67e0d8f24fcb86115e834acd19dc57027b03ea4f Mon Sep 17 00:00:00 2001 From: Jacob Bohlin Date: Thu, 20 Aug 2020 10:53:02 +0200 Subject: MLBEDSW-2663: Handle optional tensors Includes a number of changes: * Handle non-existing optional inputs * Handle disabled optional inputs (-1 indexed) * Added unit tests for parsing operators * Add bias tensor to the different Convolutions + FullyConnected if it's missing. Signed-off-by: Jacob Bohlin Change-Id: Ib88d2b610314b1c886fc0aef4f9da87430ce6ae5 --- ethosu/vela/nn_graph.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ethosu/vela/nn_graph.py') diff --git a/ethosu/vela/nn_graph.py b/ethosu/vela/nn_graph.py index bfab2270..b495828e 100644 --- a/ethosu/vela/nn_graph.py +++ b/ethosu/vela/nn_graph.py @@ -167,6 +167,8 @@ class Subgraph: visit_op_set.add(op) for inp in op.inputs: + if not inp: + continue if print_visit: print(inp, "adding consumer", op) visit_tensor(inp) @@ -190,6 +192,8 @@ class Subgraph: for ps in self.passes: for tens in ps.outputs + ps.inputs: + if not tens: + continue tens.consumer_list = [] # reset unvisited tensors to start with for tens in self.output_tensors: -- cgit v1.2.1