From 646314ef1ee268cb972f3c918a49bff85748a332 Mon Sep 17 00:00:00 2001 From: Rickard Bolin Date: Wed, 31 Jan 2024 08:42:00 +0000 Subject: MLBEDSW-8620: Fix MirrorPad supported ops check Change-Id: I1458009f4b92c1a599efa3a63d6768148e55606d Signed-off-by: Rickard Bolin --- ethosu/vela/tflite_supported_operators.py | 5 +++-- ethosu/vela/vela.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'ethosu') diff --git a/ethosu/vela/tflite_supported_operators.py b/ethosu/vela/tflite_supported_operators.py index ad61fcab..91a3ee83 100644 --- a/ethosu/vela/tflite_supported_operators.py +++ b/ethosu/vela/tflite_supported_operators.py @@ -831,10 +831,11 @@ class TFLiteSupportedOperators: @staticmethod def constraint_mirror_pad_padding_values(op): "The number of pad values for each direction must not be larger than the ifm size in that dimension" + valid = True pad_tensor = op.inputs[1].values ifm_shape = op.inputs[0].shape - for dim_padding, ifm_dim_shape in enumerate(pad_tensor, ifm_shape): - if any(dim_padding > ifm_dim_shape): + for dim_padding, ifm_dim_shape in zip(pad_tensor, ifm_shape): + if any([pad_val > ifm_dim_shape for pad_val in dim_padding]): valid = False return valid, f"IFM shape: {ifm_shape}, number of padding values per dimension: {pad_tensor}" diff --git a/ethosu/vela/vela.py b/ethosu/vela/vela.py index 66a21046..a4b93f10 100644 --- a/ethosu/vela/vela.py +++ b/ethosu/vela/vela.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright 2020-2023 Arm Limited and/or its affiliates +# SPDX-FileCopyrightText: Copyright 2020-2024 Arm Limited and/or its affiliates # # SPDX-License-Identifier: Apache-2.0 # @@ -178,7 +178,7 @@ def print_subgraph_io_summary(nng): def generate_license(): lines = [ "