diff --git a/paddle/fluid/operators/expand_op.cc b/paddle/fluid/operators/expand_op.cc index eef238302217156665ae93397cd4cc0e9410d9e5..40f7c1c54c861abebc84428f55e2769ac8969f0f 100644 --- a/paddle/fluid/operators/expand_op.cc +++ b/paddle/fluid/operators/expand_op.cc @@ -117,7 +117,7 @@ class ExpandGradOp : public framework::OperatorWithKernel { size_t start_pos = 0u; if (!ctx->IsRuntime()) { PADDLE_ENFORCE_EQ( - x_dims[i], out_dims[i], + x_dims[0], out_dims[0], "The first dimension size of Input(Out@GRAD) should be " "equal to the crroresponding dimension size of Input(X)"); start_pos = 1u;