From 54e52a9408f874e96d7872d09121f64a001b2c47 Mon Sep 17 00:00:00 2001 From: Viet-Hoa Do Date: Tue, 2 May 2023 16:20:58 +0100 Subject: Fix CPU MatMul broadcast detection Resolves: COMPMID-6155 Signed-off-by: Viet-Hoa Do Change-Id: Ie651be65404b0b737464d7a79ebcc58475863ba0 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9555 Benchmark: Arm Jenkins Tested-by: Arm Jenkins Reviewed-by: SiCong Li Comments-Addressed: Arm Jenkins --- src/cpu/operators/CpuMatMul.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/cpu/operators/CpuMatMul.cpp b/src/cpu/operators/CpuMatMul.cpp index 46858f4659..64b5167ad0 100644 --- a/src/cpu/operators/CpuMatMul.cpp +++ b/src/cpu/operators/CpuMatMul.cpp @@ -122,13 +122,8 @@ Status CpuMatMul::validate(const ITensorInfo *lhs, const ITensorInfo *rhs, const ARM_COMPUTE_RETURN_ERROR_ON_MSG(lhs_to_use->dimension(0) != rhs_to_use->dimension(1), "The product AB is defined only if the number of columns in A is equal to the number of rows in B (after transpose)"); - if(lhs_to_use->num_dimensions() > 2) - { - ARM_COMPUTE_RETURN_ERROR_ON_MSG(lhs_to_use->num_dimensions() != rhs_to_use->num_dimensions(), "Broadcasting in Batch dimension is unsupported by this operator."); - } - - // Iterate over dimensions to be collapsed in operator - check dimensions are equivelent between tensors - for(unsigned int i = 2; i < lhs_to_use->num_dimensions(); i++) + // Iterate over dimensions to be collapsed in operator - check dimensions are equivalent between tensors + for(unsigned int i = 2; i < Coordinates::num_max_dimensions; i++) { ARM_COMPUTE_RETURN_ERROR_ON_MSG(lhs_to_use->dimension(i) != rhs_to_use->dimension(i), "Broadcasting in Batch dimension is unsupported by this operator."); } -- cgit v1.2.1