diff --git a/paddle/operators/rowwise_add_op.cc b/paddle/operators/rowwise_add_op.cc index f07dd8f602cda2ba1ef02e6c6b736018288bbd9f..6825dce332adc0dc11dda187d1bd367875b8603e 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); }