From 82b820e97b90f21d7b46629bba72436a69e888e1 Mon Sep 17 00:00:00 2001 From: qiaolongfei Date: Fri, 18 Aug 2017 08:21:56 -0700 Subject: [PATCH] fix rowwise_add_grad_op --- paddle/operators/rowwise_add_op.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/operators/rowwise_add_op.cc b/paddle/operators/rowwise_add_op.cc index f07dd8f602..6825dce332 100644 --- a/paddle/operators/rowwise_add_op.cc +++ b/paddle/operators/rowwise_add_op.cc @@ -63,7 +63,7 @@ class RowwiseAddGradOp : public framework::OperatorWithKernel { "Input(Out@GRAD) should not be null"); auto dims0 = ctx.Input("X")->dims(); auto dims1 = ctx.Input("b")->dims(); - PADDLE_ENFORCE_EQ(1, framework::product(dims1), "b dims should be 1") + PADDLE_ENFORCE_EQ(1, dims1.size(), "b dims should be 1") ctx.Output(framework::GradVarName("X"))->Resize(dims0); ctx.Output(framework::GradVarName("b"))->Resize(dims1); } -- GitLab