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_writer.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_writer.py')
-rw-r--r-- | ethosu/vela/tflite_writer.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ethosu/vela/tflite_writer.py b/ethosu/vela/tflite_writer.py index f747d471..06026ba5 100644 --- a/ethosu/vela/tflite_writer.py +++ b/ethosu/vela/tflite_writer.py @@ -21,6 +21,7 @@ import numpy as np from flatbuffers import encode from flatbuffers.builder import UOffsetTFlags +from .errors import VelaError from .nn_graph import PassPlacement from .operation import Op from .tensor import MemType @@ -44,7 +45,7 @@ tflite_file_identifier = "TFL" + str(tflite_version) def FinishWithFileIdentifier(self, rootTable, fid): if fid is None or len(fid) != 4: - raise Exception("fid must be 4 chars") + raise VelaError("FileIdentifier must be 4 chars") flags = N.Uint8Flags prepSize = 4 |