aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/tflite_reader.py
diff options
context:
space:
mode:
authorMichael McGeagh <michael.mcgeagh@arm.com>2020-12-16 11:33:21 +0000
committerpatrik.gustavsson <patrik.gustavsson@arm.com>2020-12-18 15:02:32 +0000
commit528a56df829b65f7a2c61953650b123c461095f7 (patch)
treee616cdfff4b40a29d362bab51e6641ec364ae115 /ethosu/vela/tflite_reader.py
parent1a184e4a50ad2f3cc8c5bfcd23e0f875c089314c (diff)
downloadethos-u-vela-528a56df829b65f7a2c61953650b123c461095f7.tar.gz
vela: Move special error cases
Due to an issue with potential cyclical imports, especially when running individual parts of vela standalone for example with pytest, the specialised error functions are moved out of errors.py to their respective locations. The use of getattr over isinstance prevents the need to import the tensor/operator class causing the cyclical import issue. Signed-off-by: Michael McGeagh <michael.mcgeagh@arm.com> Change-Id: If8cee4b1a2562660c6a47e1c7aeb5d7fd4dd1fca
Diffstat (limited to 'ethosu/vela/tflite_reader.py')
-rw-r--r--ethosu/vela/tflite_reader.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/ethosu/vela/tflite_reader.py b/ethosu/vela/tflite_reader.py
index eff702b3..21ff8873 100644
--- a/ethosu/vela/tflite_reader.py
+++ b/ethosu/vela/tflite_reader.py
@@ -20,7 +20,6 @@ import os.path
import numpy as np
from .errors import InputFileError
-from .errors import TensorError
from .nn_graph import Graph
from .nn_graph import Subgraph
from .operation import create_activation_function
@@ -77,7 +76,7 @@ class TFLiteSubgraph:
# Fix up tensors without operations. Generate either Placeholder or Constant ops
for tens in self.inputs:
if tens.ops != []:
- TensorError(tens, "This subgraph input tensor has unexpected driving operators.")
+ tens.error("This subgraph input tensor has unexpected driving operators.")
op = Operation(Op.Placeholder, tens.name)
op.set_output_tensor(tens)