From ea4846488aad79ea90fed9d5f5db781d89865cb1 Mon Sep 17 00:00:00 2001 From: Zingo Andersen Date: Wed, 11 Nov 2026 17:36:27 +0100 Subject: [PATCH] Fix invalid padding in shared pooling tests Use kernel size 5 for padding 2 in the AvgPool and MaxPool tests. The default kernel size 3 makes PyTorch reject these cases before backend execution, causing the shared harness to skip them. Authored with OpenAI Codex. Signed-off-by: Zingo Andersen Change-Id: I7e597fa09856df9ae9a8df00b7ac5d8a71d30320 --- backends/test/suite/operators/test_avgpool1d.py | 3 ++- backends/test/suite/operators/test_avgpool2d.py | 3 ++- backends/test/suite/operators/test_maxpool1d.py | 3 ++- backends/test/suite/operators/test_maxpool2d.py | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/backends/test/suite/operators/test_avgpool1d.py b/backends/test/suite/operators/test_avgpool1d.py index 0b2d001de01..3aecfb55b0f 100644 --- a/backends/test/suite/operators/test_avgpool1d.py +++ b/backends/test/suite/operators/test_avgpool1d.py @@ -1,5 +1,6 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. +# Copyright 2026 Arm Limited and/or its affiliates. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. @@ -84,7 +85,7 @@ def test_avgpool1d_padding(self, flow: TestFlow) -> None: flow, ) self._test_op( - Model(padding=2), + Model(kernel_size=5, padding=2), (torch.randn(1, 8, 100),), flow, ) diff --git a/backends/test/suite/operators/test_avgpool2d.py b/backends/test/suite/operators/test_avgpool2d.py index 97bcb00372a..537146cc395 100644 --- a/backends/test/suite/operators/test_avgpool2d.py +++ b/backends/test/suite/operators/test_avgpool2d.py @@ -1,5 +1,6 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. +# Copyright 2026 Arm Limited and/or its affiliates. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. @@ -92,7 +93,7 @@ def test_avgpool2d_padding(self, flow: TestFlow) -> None: flow, ) self._test_op( - Model(padding=(1, 2)), + Model(kernel_size=5, padding=(1, 2)), (torch.randn(1, 8, 20, 20),), flow, ) diff --git a/backends/test/suite/operators/test_maxpool1d.py b/backends/test/suite/operators/test_maxpool1d.py index e6de4dee2b7..fdd6081e8af 100644 --- a/backends/test/suite/operators/test_maxpool1d.py +++ b/backends/test/suite/operators/test_maxpool1d.py @@ -1,5 +1,6 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. +# Copyright 2026 Arm Limited and/or its affiliates. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. @@ -86,7 +87,7 @@ def test_maxpool1d_padding(self, flow: TestFlow) -> None: flow, ) self._test_op( - Model(padding=2), + Model(kernel_size=5, padding=2), (torch.randn(1, 8, 100),), flow, ) diff --git a/backends/test/suite/operators/test_maxpool2d.py b/backends/test/suite/operators/test_maxpool2d.py index f8112d3b7da..9389a303139 100644 --- a/backends/test/suite/operators/test_maxpool2d.py +++ b/backends/test/suite/operators/test_maxpool2d.py @@ -1,5 +1,6 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. +# Copyright 2026 Arm Limited and/or its affiliates. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. @@ -91,7 +92,7 @@ def test_maxpool2d_padding(self, flow: TestFlow) -> None: flow, ) self._test_op( - Model(padding=(1, 2)), + Model(kernel_size=5, padding=(1, 2)), (torch.randn(1, 8, 20, 20),), flow, )