From 7a6f8438aaf750380a9fff799ca81ff5c7e2ae43 Mon Sep 17 00:00:00 2001 From: Michael McGeagh Date: Wed, 2 Dec 2020 15:29:22 +0000 Subject: 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 Change-Id: I0941c04e91010da1db77299517a8e2d896371e77 --- ethosu/vela/shared_buffer_allocation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ethosu/vela/shared_buffer_allocation.py') diff --git a/ethosu/vela/shared_buffer_allocation.py b/ethosu/vela/shared_buffer_allocation.py index 21b048bc..600b3170 100644 --- a/ethosu/vela/shared_buffer_allocation.py +++ b/ethosu/vela/shared_buffer_allocation.py @@ -26,7 +26,7 @@ from .architecture_features import ArchitectureFeatures from .architecture_features import Block from .architecture_features import SharedBufferArea from .architecture_features import SHRAMElements -from .errors import VelaError +from .errors import AllocationError from .ethos_u55_regs.ethos_u55_regs import resampling_mode from .operation import Kernel from .operation import NpuBlockType @@ -259,7 +259,7 @@ def find_suitable_block_configs(arch, alloc: SharedBufferAllocation) -> List[Tup if arch.override_block_config: config = alloc.try_block(arch.override_block_config) if config is None: - raise VelaError("Block config override '{0}' cannot be allocated".format(arch.override_block_config)) + raise AllocationError(f"Block config override '{arch.override_block_config}' cannot be allocated") return [config] # Constrain the search space if the OFM is smaller than the max block size -- cgit v1.2.1