From 7ccc583c7cf36fc8bb8391594ee818263247a995 Mon Sep 17 00:00:00 2001 From: Johan Gunnarsson Date: Thu, 7 Sep 2023 12:28:28 +0200 Subject: MLBEDSW-8003: Limit fixup_pool_strides to AvgPool and MaxPool This fixup is not relevant for Resize ops. Signed-off-by: Johan Gunnarsson Change-Id: I81b9d3c8a6dd820b1e5d747d754100282b93c641 --- ethosu/vela/tflite_graph_optimiser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethosu/vela/tflite_graph_optimiser.py b/ethosu/vela/tflite_graph_optimiser.py index 5107871..f686fea 100644 --- a/ethosu/vela/tflite_graph_optimiser.py +++ b/ethosu/vela/tflite_graph_optimiser.py @@ -2341,7 +2341,7 @@ def convert_shape_op_to_constant_tensor(op: Operation, arch, nng): def fixup_pool_strides(op: Operation, arch, nng): """Fixup Pool strides when the kernel size is equal to IFM shape. Stride is then irrelevant.""" - if op.type.is_pool_op(): + if op.type in (Op.AvgPool, Op.MaxPool, Op.QuantizedAvgPool, Op.QuantizedMaxPool): ifm, _ = op.get_ifm_ofm() kernel_w, kernel_h = op.get_kernel_size() if kernel_w == ifm.shape[2] and kernel_h == ifm.shape[1]: -- cgit v1.2.1