aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViet-Hoa Do <viet-hoa.do@arm.com>2023-05-02 16:20:58 +0100
committerViet-Hoa Do <viet-hoa.do@arm.com>2023-05-03 09:15:31 +0000
commit54e52a9408f874e96d7872d09121f64a001b2c47 (patch)
treebfbcd5b86760705003866b6943d2d49ec58e4f1c
parent60ab4e66ea3cb85042035fd1aafbfea666bb4ea7 (diff)
downloadComputeLibrary-54e52a9408f874e96d7872d09121f64a001b2c47.tar.gz
Fix CPU MatMul broadcast detection
Resolves: COMPMID-6155 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: Ie651be65404b0b737464d7a79ebcc58475863ba0 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9555 Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
-rw-r--r--src/cpu/operators/CpuMatMul.cpp9
1 files 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.");
}