From 6612cacc192096fa5e4d5e58b17c3df98210f805 Mon Sep 17 00:00:00 2001 From: Jacob Bohlin Date: Wed, 9 Jul 2025 17:04:48 +0100 Subject: [PATCH] MLBEDSW-10975 Fix transpose asserts to account for tensor ranks above 4 Change-Id: I3e1e1c9372552e540fa3c22f047fe9679d31720b Signed-off-by: Jacob Bohlin --- .../ethosu55/ethos_u55_register_cs_generator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ethosu/regor/architecture/ethosu55/ethos_u55_register_cs_generator.cpp b/ethosu/regor/architecture/ethosu55/ethos_u55_register_cs_generator.cpp index 62380fa1..f9b4b39b 100644 --- a/ethosu/regor/architecture/ethosu55/ethos_u55_register_cs_generator.cpp +++ b/ethosu/regor/architecture/ethosu55/ethos_u55_register_cs_generator.cpp @@ -1397,14 +1397,14 @@ void EthosU55RCSGenerator::InsertTransposeCommand(const HLCStripe *stripe, Tempo depth = sliceShape.Depth(); slices = 1; ifmStep = ofmStep = 0; - assert(from == 1 && to == 2); + assert((from == ifm.shape.Size() - 3) && (to == ifm.shape.Size() - 2)); } else if ( ofm.transpose == TransposeType::NHCW ) { depth = 1; slices = ifm.shape.Height(); ifmStep = ofmStep = ifm.shape.ElementsWC() * elementSize; - assert(from == 2 && to == 3); + assert((from == ifm.shape.Size() - 2) && (to == ifm.shape.Size() - 1)); } else if ( ofm.transpose == TransposeType::NCWH ) { @@ -1413,7 +1413,7 @@ void EthosU55RCSGenerator::InsertTransposeCommand(const HLCStripe *stripe, Tempo slices = ifm.shape.Width(); ifmStep = ifm.shape.Depth() * elementSize; ofmStep = ifm.shape.Height() * elementSize; - assert(from == 1 && to == 3); + assert((from == ifm.shape.Size() - 3) && (to == ifm.shape.Size() - 1)); } else { -- GitLab