Skip to content

Commit 3b03e37

Browse files
committed
Refine some ENFORCE.
1 parent 58730ba commit 3b03e37

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

paddle/fluid/operators/sequence_expand_op.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class SequenceExpandOp : public framework::OperatorWithKernel {
4949
auto& y_lod = y_var->Get<LoDTensor>().lod();
5050

5151
PADDLE_ENFORCE_LE(x_lod.size(), 1,
52-
"Number of lod level of Input(X) should not be "
52+
"Level number of Input(X)'s lod should not be "
5353
"greater than 1.");
5454
PADDLE_ENFORCE_GT(y_lod.size(), 0,
5555
"Level number of Input(Y)'s lod should be "
@@ -64,11 +64,10 @@ class SequenceExpandOp : public framework::OperatorWithKernel {
6464
if (ref_level == -1) ref_level = y_lod.size() - 1;
6565

6666
if (x_lod.size() > 0) {
67-
PADDLE_ENFORCE(
68-
x_lod.size() == 0 || x_lod[0].size() == y_lod[ref_level].size(),
69-
"Level number of Input(X)'s lod should be 0. Otherwise "
70-
"size of Input(X)'s first level lod should be equal to "
71-
"size of Input(Y)'s lod of referred level.");
67+
PADDLE_ENFORCE(x_lod[0].size() == y_lod[ref_level].size(),
68+
"Level number of Input(X)'s lod could be 0. Otherwise "
69+
"size of Input(X)'s first level lod should be equal to "
70+
"size of Input(Y)'s referred level lod.");
7271
}
7372

7473
int64_t out_first_dim = 0;

0 commit comments

Comments
 (0)