diff options
author | Louis Verhaard <louis.verhaard@arm.com> | 2021-01-27 15:57:57 +0100 |
---|---|---|
committer | patrik.gustavsson <patrik.gustavsson@arm.com> | 2021-02-01 16:44:39 +0000 |
commit | ebf4af6a45c60d3f75ccd6019612a7f8b6552d72 (patch) | |
tree | 79a84e13a59ee8c0c4e11aa7bb0fe008f4a4ab29 /ethosu/vela/operation.py | |
parent | 189f748e1a79ed88044efbe7137963bca830cbb5 (diff) | |
download | ethos-u-vela-ebf4af6a45c60d3f75ccd6019612a7f8b6552d72.tar.gz |
MLBEDSW-3903: Bug fix PAD operator
- Added checks for unsupported pad sizes in PAD operator
- Bug fix right pad/bottom pad calculation when replacing PAD operator
by hardware padding
Change-Id: Ib84be711277d987052f14352ab386e0e0b774987
Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
Diffstat (limited to 'ethosu/vela/operation.py')
-rw-r--r-- | ethosu/vela/operation.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ethosu/vela/operation.py b/ethosu/vela/operation.py index 73953cec..963d9e69 100644 --- a/ethosu/vela/operation.py +++ b/ethosu/vela/operation.py @@ -1,4 +1,4 @@ -# Copyright (C) 2020 Arm Limited or its affiliates. All rights reserved. +# Copyright (C) 2020-2021 Arm Limited or its affiliates. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 # @@ -22,6 +22,7 @@ from typing import Any from typing import Dict from typing import List from typing import Optional +from typing import Tuple from typing import TYPE_CHECKING from .errors import VelaError @@ -68,6 +69,10 @@ class Kernel: def area_height(self) -> int: return (self.height - 1) * self.dilation.y + 1 + def dilated_wh(self) -> Tuple[int, int]: + """Returns the dilated kernel width/height""" + return self.dilation.x * (self.width - 1) + 1, self.dilation.y * (self.height - 1) + 1 + def __str__(self): return f"w={self.width}, h={self.height}, stride={tuple(self.stride)}, dilation={tuple(self.dilation)}" |