Skip to content

Commit 90fc4a6

Browse files
authored
Complete shrink_rnn_memory_op comments (#5935)
* Complete shrink_rnn_memory_op comments * Update
1 parent ed516e0 commit 90fc4a6

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

paddle/operators/shrink_rnn_memory_op.cc

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,21 @@ class ShrinkRNNMemoryOpProtoMaker : public framework::OpProtoAndCheckerMaker {
5757
ShrinkRNNMemoryOpProtoMaker(framework::OpProto *proto,
5858
framework::OpAttrChecker *op_checker)
5959
: OpProtoAndCheckerMaker(proto, op_checker) {
60-
AddInput("X", "");
61-
AddInput("RankTable", "");
62-
AddInput("I", "");
63-
AddOutput("Out", "");
64-
AddComment("");
60+
AddInput("X", "(LoDTensor) The RNN step memory to be shrinked.");
61+
AddInput("RankTable", "(LoDRankTable) The lod_rank_table of dynamic RNN.");
62+
AddInput("I",
63+
"(LoDTensor) The step index. The RNN step memory 'X' will be "
64+
"shrinked to match the size of the input of the index'th step.");
65+
AddOutput("Out", "(LoDTensor) The shrinked RNN step memory.");
66+
AddComment(
67+
R"DOC(
68+
In dynamic RNN, we are able to handle sequences of different lengths.
69+
Because of the multiple lengths, the size of each step input can be
70+
different, which may lead to a mismatching between the input of
71+
the current step and the memory generated by the previous one. This
72+
operator shrinks memory according to the size of the next step input,
73+
to make sure that they can match each other.
74+
)DOC");
6575
}
6676
};
6777

0 commit comments

Comments
 (0)