MLBEDSW-2436: Support for HardSwish operator
- Added support for HardSwish (placed on CPU)
- Improved error reporting for unknown operator codes in input file
Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
Change-Id: I1d1c7b9d786288d7098450cdad2b67fc0759378b
diff --git a/ethosu/vela/tflite_reader.py b/ethosu/vela/tflite_reader.py
index 5ab90f0..84c4c3c 100644
--- a/ethosu/vela/tflite_reader.py
+++ b/ethosu/vela/tflite_reader.py
@@ -19,6 +19,7 @@
import numpy as np
+from .errors import InputFileError
from .errors import UnsupportedFeatureError
from .nn_graph import Graph
from .nn_graph import Subgraph
@@ -228,6 +229,9 @@
def parse_operator_code(self, code):
c = code.BuiltinCode()
+ if not c in builtin_operator_map:
+ msg = "The input file contains operator code {} which is currently not supported".format(c)
+ raise InputFileError(self.name, msg)
op_type, ser = builtin_operator_map[c]
if c == BuiltinOperator.CUSTOM:
op_type += decode_str(code.CustomCode())