From c822d62ba27b874a130e9d8d434c12b419d10d62 Mon Sep 17 00:00:00 2001 From: Louis Verhaard Date: Thu, 11 Mar 2021 14:59:06 +0100 Subject: 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 --- ethosu/vela/test/testutil.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ethosu/vela/test/testutil.py') 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 -- cgit v1.2.1