aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/operation.py
diff options
context:
space:
mode:
authorJacob Bohlin <jacob.bohlin@arm.com>2020-08-20 10:53:02 +0200
committertim.hall <tim.hall@arm.com>2020-08-21 15:30:36 +0000
commit67e0d8f24fcb86115e834acd19dc57027b03ea4f (patch)
tree748a85cc9aca976b74e18d1e4bead38344c32922 /ethosu/vela/operation.py
parent1575b9413de2569de25bb2520b898a91f24ad3b0 (diff)
downloadethos-u-vela-67e0d8f24fcb86115e834acd19dc57027b03ea4f.tar.gz
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 <jacob.bohlin@arm.com> Change-Id: Ib88d2b610314b1c886fc0aef4f9da87430ce6ae5
Diffstat (limited to 'ethosu/vela/operation.py')
-rw-r--r--ethosu/vela/operation.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ethosu/vela/operation.py b/ethosu/vela/operation.py
index 3b34fe81..c1ca3f81 100644
--- a/ethosu/vela/operation.py
+++ b/ethosu/vela/operation.py
@@ -312,6 +312,15 @@ input and output tensors, as well as an attribute dictionary."""
if self not in tens.consumer_list:
tens.consumer_list.append(self)
+ def set_input_tensor(self, tens, idx):
+ tens_to_remove = self.inputs[idx]
+ if tens_to_remove in tens.consumer_list:
+ tens.consumer_list.remove(tens_to_remove)
+
+ self.inputs[idx] = tens
+ if self not in tens.consumer_list:
+ tens.consumer_list.append(self)
+
def set_output_tensor(self, tens):
tens.ops = [self]
self.outputs = [tens]