diff options
author | Jonas Ohlsson <jonas.ohlsson@arm.com> | 2021-09-01 15:57:21 +0200 |
---|---|---|
committer | Jonas Ohlsson <jonas.ohlsson@arm.com> | 2021-09-15 10:48:08 +0100 |
commit | 0957e3ef4b94f17efb67429c88bab8ba650f78e8 (patch) | |
tree | f3e2600367bc7c89145657023b45b9dde2c316c2 /ethosu/vela/graph_optimiser.py | |
parent | 1a7527cd4ad56b49f120b10dc5e87a1e8f5a8122 (diff) | |
download | ethos-u-vela-0957e3ef4b94f17efb67429c88bab8ba650f78e8.tar.gz |
MLBEDSW-5102 Update removal of memory only operators
Memory only operators such as Reshape, Squeeze and ExpandDims are
removed in the graph optimiser step.
- Added semantic check that memory only operators have same
quantisation parameters on ifm/ofm.
- Added support for the ExpandDims operator.
- Addition and cleanup of related unit tests.
- Removed TOSA from the generated SUPPORTED_OPS.md documentation.
Signed-off-by: Jonas Ohlsson <jonas.ohlsson@arm.com>
Change-Id: If848d8afc58c18806e10997ed94e4dae83f30879
Diffstat (limited to 'ethosu/vela/graph_optimiser.py')
-rw-r--r-- | ethosu/vela/graph_optimiser.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ethosu/vela/graph_optimiser.py b/ethosu/vela/graph_optimiser.py index 87e3bc8d..0f5636ed 100644 --- a/ethosu/vela/graph_optimiser.py +++ b/ethosu/vela/graph_optimiser.py @@ -17,7 +17,7 @@ # Early optimisation of the network graph, using the rewrite_graph module to do the traversal of the graph. from . import rewrite_graph from .graph_optimiser_util import check_format_restrictions -from .graph_optimiser_util import check_reshapes +from .graph_optimiser_util import check_memory_only_removed from .graph_optimiser_util import record_optimised from .nn_graph import NetworkType from .tflite_graph_optimiser import tflite_optimise_graph @@ -38,7 +38,7 @@ def optimise_graph(nng, arch, network_type, verbose_graph=False): # Post-optimisation operator debug tracing, and checking that no undesired reshapes are left in the graph for sg in nng.subgraphs: rewrite_graph.visit_graph_post_order( - sg.output_tensors, arch, [check_format_restrictions], [check_reshapes, record_optimised] + sg.output_tensors, arch, [check_format_restrictions], [check_memory_only_removed, record_optimised] ) if verbose_graph: |