Skip to content

Commit 21d6e8e

Browse files
committed
Polish code
test=develop
1 parent 50b6e4c commit 21d6e8e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

paddle/fluid/operators/expand_op.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ class ExpandGradOp : public framework::OperatorWithKernel {
116116

117117
size_t start_pos = 0u;
118118
if (!ctx->IsRuntime()) {
119+
PADDLE_ENFORCE_EQ(
120+
x_dims[i], out_dims[i],
121+
"The first dimension size of Input(Out@GRAD) should be "
122+
"equal to the crroresponding dimension size of Input(X)");
119123
start_pos = 1u;
120124
}
121125

0 commit comments

Comments
 (0)