MLBEDSW-5554: Place MEAN op exceeding max height with axis==1 on CPU
Signed-off-by: Rickard Bolin <rickard.bolin@arm.com>
Change-Id: I87dc5963972a7ef91db467b2ff8e0261e9899372
diff --git a/ethosu/vela/tflite_graph_optimiser.py b/ethosu/vela/tflite_graph_optimiser.py
index e01433d..7b10f86 100644
--- a/ethosu/vela/tflite_graph_optimiser.py
+++ b/ethosu/vela/tflite_graph_optimiser.py
@@ -1301,8 +1301,8 @@
if dims == 2:
shape += [1]
- # If height is greater than max kernel height, reshape to from HxW to 1x(HxW)
- if h > 64:
+ # If height is greater than max kernel height, reshape from HxW to 1x(HxW)
+ if (h > 64 and op.type == Op.DepthwiseConv2DBias) or (h > 256 and op.type == Op.AvgPool):
shape = [shape[0], 1, h * w, shape[3]]
op.ifm_shapes[0] = Shape4D(shape)
if h > 256 and op.type == Op.AvgPool: