未验证 提交 e176a079 编写于 作者: W whs 提交者: GitHub

Merge pull request #8297 from wanghaoshuang/fix_compare_op

Remove 'numel' checker in compare op
...@@ -58,8 +58,8 @@ class CompareOpInferShape : public framework::InferShapeBase { ...@@ -58,8 +58,8 @@ class CompareOpInferShape : public framework::InferShapeBase {
comment.type); comment.type);
auto dim_x = context->GetInputDim("X"); auto dim_x = context->GetInputDim("X");
auto dim_y = context->GetInputDim("Y"); auto dim_y = context->GetInputDim("Y");
PADDLE_ENFORCE_EQ(framework::product(dim_x), framework::product(dim_y), PADDLE_ENFORCE_GE(dim_x.size(), dim_y.size(),
"The number of elements in X and Y should be same"); "The size of dim_y should not be greater than dim_x's.");
context->SetOutputDim("Out", context->GetInputDim("X")); context->SetOutputDim("Out", context->GetInputDim("X"));
context->ShareLoD("X", "Out"); context->ShareLoD("X", "Out");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册