From 678645b7b7b788543e08fe0767cce784cb92a1f9 Mon Sep 17 00:00:00 2001 From: Louis Verhaard Date: Mon, 15 Jun 2020 15:22:47 +0200 Subject: 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 Change-Id: I1d1c7b9d786288d7098450cdad2b67fc0759378b --- ethosu/vela/tflite_reader.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ethosu/vela/tflite_reader.py') 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()) -- cgit v1.2.1