aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tflite_supported_operators.py
diff options
context:
space:
mode:
authorJohan Alfvén <johan.alfven@arm.com>2022-09-28 14:22:54 +0200
committerJohan Alfvén <johan.alfven@arm.com>2022-10-28 09:45:42 +0200
commit8484d6e529bc7828d3e5034cd9dfcfb1ddb0559a (patch)
treeb2d094e7a405c9b78636f2a072796a184f35aa7c /ethosu/vela/tflite_supported_operators.py
parent53605be9fb83fb0a0fa873a0f4d7435654d3df6b (diff)
downloadethos-u-vela-8484d6e529bc7828d3e5034cd9dfcfb1ddb0559a.tar.gz
Revert "MLBEDSW-6961: Bypass functionality for memory ops"
This reverts commit 5060ff53f5ac2382e04a68d7772bd71a36f63845. Signed-off-by: Johan Alfven <johan.alfven@arm.com> Change-Id: I8dd7e9ed8325fd2e8c17509fd9757292706f5ee7
Diffstat (limited to 'ethosu/vela/tflite_supported_operators.py')
-rw-r--r--ethosu/vela/tflite_supported_operators.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ethosu/vela/tflite_supported_operators.py b/ethosu/vela/tflite_supported_operators.py
index b8fe4b6a..c394778b 100644
--- a/ethosu/vela/tflite_supported_operators.py
+++ b/ethosu/vela/tflite_supported_operators.py
@@ -319,6 +319,7 @@ class TFLiteSupportedOperators:
# Reshape specific checks:
self.specific_constraints[Op.Reshape].append(TFLiteSupportedOperators.constraint_reshape_shape_constant)
+ self.specific_constraints[Op.Reshape].append(TFLiteSupportedOperators.constraint_reshape_before_mean)
def is_operator_supported(self, op):
ext_type = optype_to_builtintype(op.type)
@@ -879,3 +880,11 @@ class TFLiteSupportedOperators:
extra = ", ".join(extra)
return valid, f"Op has non-const input(s): {extra}"
+
+ @staticmethod
+ def constraint_reshape_before_mean(op):
+ "Reshape on NPU not supported before MEAN operator"
+ for next_op in op.outputs[0].consumers():
+ if next_op is not None and next_op.type == Op.Mean:
+ return False, ""
+ return True, ""