aboutsummaryrefslogtreecommitdiff
path: root/ethosu/vela/high_level_command_to_npu_op.py
diff options
context:
space:
mode:
authorMichael McGeagh <michael.mcgeagh@arm.com>2020-12-02 15:29:22 +0000
committerMichael McGeagh <michael.mcgeagh@arm.com>2020-12-14 11:38:03 +0000
commit7a6f8438aaf750380a9fff799ca81ff5c7e2ae43 (patch)
tree163c6868ec869ae52a5cfd848207dcf0ef7b212e /ethosu/vela/high_level_command_to_npu_op.py
parent9b43f846b144d39bfb0cf16853bf6901c74b6672 (diff)
downloadethos-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/high_level_command_to_npu_op.py')
-rw-r--r--ethosu/vela/high_level_command_to_npu_op.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ethosu/vela/high_level_command_to_npu_op.py b/ethosu/vela/high_level_command_to_npu_op.py
index 9e0ed010..096a65cc 100644
--- a/ethosu/vela/high_level_command_to_npu_op.py
+++ b/ethosu/vela/high_level_command_to_npu_op.py
@@ -46,6 +46,7 @@ from .architecture_features import ArchitectureFeatures
from .architecture_features import Block
from .data_type import DataType
from .debug_database import DebugDatabase
+from .errors import UnsupportedFeatureError
from .high_level_command_stream import Box
from .high_level_command_stream import Command
from .high_level_command_stream import DMA
@@ -307,7 +308,7 @@ def create_npu_activation(op: Operation) -> NpuActivation:
elif faf == Op.LUT:
act_op = NpuActivationOp.TABLE_LOOKUP
elif not faf.is_relu_op():
- raise Exception("Unsupported fused_activation_function = " + faf.name)
+ raise UnsupportedFeatureError(f"Unsupported fused_activation_function: {faf.name}")
act = NpuActivation(act_op)
act.min = op.activation.min