From 67e4ff84d144ba10c1e2484f6bf30652bc9e8322 Mon Sep 17 00:00:00 2001 From: wanghaoshuang Date: Fri, 9 Feb 2018 10:33:32 +0800 Subject: [PATCH] Remove checking 'numel' of 'X' and 'Y' --- paddle/operators/compare_op.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/operators/compare_op.cc b/paddle/operators/compare_op.cc index 930c295a9cb..51b5bcb38f9 100644 --- a/paddle/operators/compare_op.cc +++ b/paddle/operators/compare_op.cc @@ -58,8 +58,8 @@ class CompareOpInferShape : public framework::InferShapeBase { comment.type); auto dim_x = context->GetInputDim("X"); auto dim_y = context->GetInputDim("Y"); - PADDLE_ENFORCE_EQ(framework::product(dim_x), framework::product(dim_y), - "The number of elements in X and Y should be same"); + PADDLE_ENFORCE_GE(dim_x.size(), dim_y.size(), + "The size of dim_y should not be greater than dim_x's."); context->SetOutputDim("Out", context->GetInputDim("X")); context->ShareLoD("X", "Out"); -- GitLab