diff options
author | Louis Verhaard <louis.verhaard@arm.com> | 2021-03-11 14:59:06 +0100 |
---|---|---|
committer | Louis Verhaard <louis.verhaard@arm.com> | 2021-03-16 10:37:20 +0100 |
commit | c822d62ba27b874a130e9d8d434c12b419d10d62 (patch) | |
tree | 4450a032513b537ffd3545cb2bdb6e052339beb2 /ethosu/vela/operation_util.py | |
parent | 8ba0792731d47de64a59d93359340f3c88fc4a62 (diff) | |
download | ethos-u-vela-c822d62ba27b874a130e9d8d434c12b419d10d62.tar.gz |
MLBEDSW-4223: Full support for PAD operator
- Added full support for PAD operator
- Hardware padding is still used whenever possible
- Bug fix Pad followed by max pool if IFM contains negative values
Change-Id: Ifc64d1943737d94466f5e2821009dab12a49a965
Signed-off-by: Louis Verhaard <louis.verhaard@arm.com>
Diffstat (limited to 'ethosu/vela/operation_util.py')
-rw-r--r-- | ethosu/vela/operation_util.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ethosu/vela/operation_util.py b/ethosu/vela/operation_util.py index 82a7fb8b..417f27ef 100644 --- a/ethosu/vela/operation_util.py +++ b/ethosu/vela/operation_util.py @@ -40,6 +40,7 @@ def create_avgpool_nop(name: str) -> Operation: op.attrs["ksize"] = [1, 1, 1, 1] op.attrs["skirt"] = [0, 0, 0, 0] op.attrs["explicit_padding"] = [0, 0, 0, 0] + op.run_on_npu = True return op @@ -259,3 +260,8 @@ def create_binary_elementwise( op.set_output_tensor(ofm) op.ofm_shapes.append(ofm_shape) return op + + +def get_pad_values_from_input(padding) -> Tuple: + """Returns top, left, bottom, right padding from input values in a Pad input tensor""" + return (padding[-3][0], padding[-2][0], padding[-3][1], padding[-2][1]) |