From 0a4719e414044f79ef24e9cd169d82e92a3e71dc Mon Sep 17 00:00:00 2001 From: Alexander Bengtsson Date: Fri, 28 Mar 2025 12:01:33 +0100 Subject: [PATCH] MLBEDSW-10625: Fix assert in ConstraintSoftmax - Pad ifmShape to 4D before performing softmax constraint-checks Change-Id: I5bb981e851876c5c30a2e8814bc73b03f0a43624 Signed-off-by: Alexander Bengtsson --- ethosu/regor/tflite/tflite_supported_operators.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethosu/regor/tflite/tflite_supported_operators.cpp b/ethosu/regor/tflite/tflite_supported_operators.cpp index 10643b9f..e5454b26 100644 --- a/ethosu/regor/tflite/tflite_supported_operators.cpp +++ b/ethosu/regor/tflite/tflite_supported_operators.cpp @@ -712,7 +712,7 @@ bool TfLiteSupportedOperators::ConstraintSoftmax(const Operation *op) auto ifmConn = op->Input(TensorUsage::IFM); assert(ifmConn); static constexpr int maxProd = 1 << 16; - const auto &ifmShape = ifmConn->shape; + const auto ifmShape = Shape::PadAxes(ifmConn->shape, 4, 1); if ( ifmShape.ElementsWH() > maxProd ) { Failure(op, fmt::format("ifmShape: ({}), W * H = {}", ifmShape.ToString(), ifmShape.ElementsWH()), -- GitLab