diff options
author | Michael McGeagh <michael.mcgeagh@arm.com> | 2020-12-02 15:29:22 +0000 |
---|---|---|
committer | Michael McGeagh <michael.mcgeagh@arm.com> | 2020-12-14 11:38:03 +0000 |
commit | 7a6f8438aaf750380a9fff799ca81ff5c7e2ae43 (patch) | |
tree | 163c6868ec869ae52a5cfd848207dcf0ef7b212e /ethosu/vela/tflite_reader.py | |
parent | 9b43f846b144d39bfb0cf16853bf6901c74b6672 (diff) | |
download | ethos-u-vela-7a6f8438aaf750380a9fff799ca81ff5c7e2ae43.tar.gz |
MLBEDSW-2066 Improve Exception messages
Minor refactoring to use fstrings.
Improve Error classes to correctly inherit the base class.
Use existing exception classes instead of plain exceptions where it
makes sense.
Signed-off-by: Michael McGeagh <michael.mcgeagh@arm.com>
Change-Id: I0941c04e91010da1db77299517a8e2d896371e77
Diffstat (limited to 'ethosu/vela/tflite_reader.py')
-rw-r--r-- | ethosu/vela/tflite_reader.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ethosu/vela/tflite_reader.py b/ethosu/vela/tflite_reader.py index df52478a..eff702b3 100644 --- a/ethosu/vela/tflite_reader.py +++ b/ethosu/vela/tflite_reader.py @@ -264,8 +264,9 @@ class TFLiteGraph: def parse_operator_code(self, code): c = code.BuiltinCode() if c not in builtin_operator_map: - msg = "The input file contains operator code {} which is currently not supported".format(c) - raise InputFileError(self.name, msg) + raise InputFileError( + self.name, f"The input file contains operator code '{c}' which is currently not supported" + ) op_type, ser = builtin_operator_map[c] custom_code = None if c == BuiltinOperator.CUSTOM: |