aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tflite_reader.py
diff options
context:
space:
mode:
authorLouis Verhaard <louis.verhaard@arm.com>2020-06-15 15:22:47 +0200
committerTim Hall <tim.hall@arm.com>2020-06-18 17:53:52 +0100
commit678645b7b7b788543e08fe0767cce784cb92a1f9 (patch)
treec7813e99b75aef26bb6e07622ce5c85e02f6eba7 /ethosu/vela/tflite_reader.py
parent19515e8fbb1e23c63d6bb963054deb09dae66e88 (diff)
downloadethos-u-vela-678645b7b7b788543e08fe0767cce784cb92a1f9.tar.gz
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
Diffstat (limited to 'ethosu/vela/tflite_reader.py')
-rw-r--r--ethosu/vela/tflite_reader.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ethosu/vela/tflite_reader.py b/ethosu/vela/tflite_reader.py
index 5ab90f04..84c4c3c2 100644
--- a/ethosu/vela/tflite_reader.py
+++ b/ethosu/vela/tflite_reader.py
@@ -19,6 +19,7 @@ import os.path
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 @@ class TFLiteGraph:
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())