aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/test/testutil.py
diff options
context:
space:
mode:
authorLouis Verhaard <louis.verhaard@arm.com>2021-03-11 14:59:06 +0100
committerLouis Verhaard <louis.verhaard@arm.com>2021-03-16 10:37:20 +0100
commitc822d62ba27b874a130e9d8d434c12b419d10d62 (patch)
tree4450a032513b537ffd3545cb2bdb6e052339beb2 /ethosu/vela/test/testutil.py
parent8ba0792731d47de64a59d93359340f3c88fc4a62 (diff)
downloadethos-u-vela-c822d62ba27b874a130e9d8d434c12b419d10d62.tar.gz
MLBEDSW-4223: Full support for PAD operator
- Added full support for PAD operator - Hardware padding is still used whenever possible - Bug fix Pad followed by max pool if IFM contains negative values Change-Id: Ifc64d1943737d94466f5e2821009dab12a49a965 Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
Diffstat (limited to 'ethosu/vela/test/testutil.py')
-rw-r--r--ethosu/vela/test/testutil.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ethosu/vela/test/testutil.py b/ethosu/vela/test/testutil.py
index aef5f613..25dc801b 100644
--- a/ethosu/vela/test/testutil.py
+++ b/ethosu/vela/test/testutil.py
@@ -19,6 +19,8 @@ import numpy as np
from ethosu.vela import architecture_features
from ethosu.vela.data_type import DataType
+from ethosu.vela.nn_graph import Graph
+from ethosu.vela.nn_graph import PassPlacement
from ethosu.vela.nn_graph import Subgraph
from ethosu.vela.operation import Op
from ethosu.vela.operation import Operation
@@ -128,6 +130,7 @@ def create_op(op_type, inputs, output, attrs=None, set_ifm_ofm_shapes=True):
def create_subgraph(op_list):
# Creates subgraph using the given list of operations
sg = Subgraph()
+ sg.placement = PassPlacement.Npu
all_inputs = set(tens for op in op_list for tens in op.inputs)
# Reversing, so that the resulting subgraph has same order as op_list
for op in op_list[::-1]:
@@ -135,3 +138,11 @@ def create_subgraph(op_list):
if tens not in all_inputs and tens not in sg.output_tensors:
sg.output_tensors.append(tens)
return sg
+
+
+def create_graph(op_list):
+ # Creates subgraph using the given list of operations
+ nng = Graph()
+ sg = create_subgraph(op_list)
+ nng.subgraphs.append(sg)
+ return nng