Skip to content

Commit 84f471b

Browse files
committed
Fix comments
1 parent 8d4e2d4 commit 84f471b

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

paddle/operators/seq_expand_op.cc

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ class SeqExpandOp : public framework::OperatorWithKernel {
2727
void InferShape(framework::InferShapeContext* ctx) const override {
2828
PADDLE_ENFORCE(ctx->HasInput("X"));
2929
PADDLE_ENFORCE(ctx->HasOutput("Out"));
30-
PADDLE_ENFORCE(
31-
ctx->HasInput("Y"),
32-
"Input(Y) of SeqExpandOp should not be null while repeat == 0.");
30+
PADDLE_ENFORCE(ctx->HasInput("Y"));
3331
framework::DDim out_dim;
3432
out_dim = ctx->GetInputDim("Y");
3533
ctx->ShareLoD("Y", "Out");
@@ -43,14 +41,14 @@ class SeqExpandOpMaker : public framework::OpProtoAndCheckerMaker {
4341
framework::OpAttrChecker* op_checker)
4442
: OpProtoAndCheckerMaker(proto, op_checker) {
4543
AddInput("X",
46-
"(Tensor or LoDTensor) The input('X') of this operator can be a "
44+
"(Tensor or LoDTensor) The input(X) of this operator can be a "
4745
"LoDTensor or a base Tensor.");
4846
AddInput("Y",
49-
"(LoDTensor)The reference input('Y') of seq_expand op."
47+
"(LoDTensor)The reference input(Y) of seq_expand op."
5048
"It must be a LoDTensor with k-level(k>0)."
51-
"Input(X) will be expanded according to LOD of input(Y)."
52-
"The element numbers of last level in input('Y') "
53-
"must be equal to dims[0] of input('X').");
49+
"The input(X) will be expanded according to LOD of input(Y)."
50+
"The element numbers of last level in input(Y) "
51+
"must be equal to dims[0] of input(X).");
5452
AddOutput("Out",
5553
"(LodTensor)The output of seq_expand op."
5654
"The lod of output will be as same as input(Y)'s lod.");
@@ -133,7 +131,7 @@ class SeqExpandOpGrad : public framework::OperatorWithKernel {
133131
PADDLE_ENFORCE(ctx->HasInput("X"));
134132
PADDLE_ENFORCE(ctx->HasInput("Out"));
135133
PADDLE_ENFORCE(ctx->HasInput(framework::GradVarName("Out")),
136-
"Input(Out@GRAD) should not be null");
134+
"The input(Out@GRAD) should not be null");
137135
auto x_dims = ctx->GetInputDim("X");
138136
auto x_grad_name = framework::GradVarName("X");
139137
if (ctx->HasOutput(x_grad_name)) {

0 commit comments

Comments
 (0)