@@ -47,19 +47,19 @@ class SequenceConcatOpMaker : public framework::OpProtoAndCheckerMaker {
4747 framework::OpAttrChecker* op_checker)
4848 : OpProtoAndCheckerMaker(proto, op_checker) {
4949 AddInput (" X" ,
50- " (A vector of LoDTensor), the input is a vector of LoDTensor, "
50+ " (vector< LoDTensor>) Input is a vector of LoDTensor, "
5151 " each of which is a variable-length sequence or nested sequence." )
5252 .AsDuplicable ();
5353 AddOutput (" Out" ,
54- " (A LoDTensor), the variable -length output of "
54+ " (LoDTensor), Variable -length output of "
5555 " sequence_concat Op." );
5656 AddAttr<int >(" axis" ,
57- " (int, default 0)"
58- " The axis which the inputs will be joined with . "
57+ " (int, default 0) "
58+ " The axis along which the inputs will be joined. "
5959 " If axis is 0, the inputs will be joined with LoD index." )
6060 .SetDefault (0 );
6161 AddAttr<int >(" level" ,
62- " (int, default 0)"
62+ " (int, default 0) "
6363 " The level at which the inputs will be joined. "
6464 " If the level is 0, the inputs will be joined at the nested "
6565 " sequence level. "
@@ -68,34 +68,36 @@ class SequenceConcatOpMaker : public framework::OpProtoAndCheckerMaker {
6868 " The level should be less than the level number of inputs." )
6969 .SetDefault (0 );
7070 AddComment (R"DOC(
71- The sequence_concat operator concatenates multiple LoDTensors.
72- It only supports sequence (LoD Tensor with level number is 1)
73- or a nested sequence (LoD tensor with level number is 2) as its input.
74- - Case1:
75- If the axis is other than 0(here, axis is 1 and level is 1),
76- each input should have the same LoD information and the LoD
77- information of the output keeps the same as the input.
78-
79- LoD(x0) = {{0,2,4}, {0,1,2,3,4}}; Dims(x0) = (4,3,4)
80- LoD(x1) = {{0,2,4}, {0,1,2,3,4}}; Dims(x1) = (4,4,4)
81- LoD(Out) = {{0,2,4}, {0,1,2,3,4}}; Dims(Out) = (4,7,4)
82-
83- - Case2:
84- If the axis is 0(here, leve is 0), the inputs are concatenated along
85- time steps, the LoD information of the output need to re-compute.
86-
87- LoD(x0) = {{0,2,4}, {0,1,2,3,4}}; Dims(x0) = (4,3,4)
88- LoD(x1) = {{0,3,5}, {0,1,2,3,5}}; Dims(x1) = (5,3,4)
89- LoD(Out) = {{0,5,9}, {0,1,2,3,4,5,6,7,9}}; Dims(Out) = (9,3,4)
90-
91- - Case3:
92- If the axis is 0(here, level is 1).
93-
94- LoD(x0) = {{0,2,4}, {0,1,2,3,4}}; Dims(x0) = (4,3,4)
95- LoD(x1) = {{0,3,5}, {0,1,3,4,5}}; Dims(x1) = (5,3,4)
96- LoD(Out) = {{0,5,9}, {0,2,5,7,9}}; Dims(Out) = (9,3,4)
97-
98- NOTE: The levels of all the inputs should be the same.
71+ Sequence Concat operator
72+
73+ The sequence_concat operator concatenates multiple LoDTensors.
74+ It only supports sequence (LoD Tensor with level number is 1)
75+ or a nested sequence (LoD tensor with level number is 2) as its input.
76+ - Case1:
77+ If the axis is other than 0(here, axis is 1 and level is 1),
78+ each input should have the same LoD information and the LoD
79+ information of the output keeps the same as the input.
80+
81+ LoD(x0) = {{0,2,4}, {0,1,2,3,4}}; Dims(x0) = (4,3,4)
82+ LoD(x1) = {{0,2,4}, {0,1,2,3,4}}; Dims(x1) = (4,4,4)
83+ LoD(Out) = {{0,2,4}, {0,1,2,3,4}}; Dims(Out) = (4,7,4)
84+
85+ - Case2:
86+ If the axis is 0(here, leve is 0), the inputs are concatenated along
87+ time steps, the LoD information of the output need to re-compute.
88+
89+ LoD(x0) = {{0,2,4}, {0,1,2,3,4}}; Dims(x0) = (4,3,4)
90+ LoD(x1) = {{0,3,5}, {0,1,2,3,5}}; Dims(x1) = (5,3,4)
91+ LoD(Out) = {{0,5,9}, {0,1,2,3,4,5,6,7,9}}; Dims(Out) = (9,3,4)
92+
93+ - Case3:
94+ If the axis is 0(here, level is 1).
95+
96+ LoD(x0) = {{0,2,4}, {0,1,2,3,4}}; Dims(x0) = (4,3,4)
97+ LoD(x1) = {{0,3,5}, {0,1,3,4,5}}; Dims(x1) = (5,3,4)
98+ LoD(Out) = {{0,5,9}, {0,2,5,7,9}}; Dims(Out) = (9,3,4)
99+
100+ NOTE: The levels of all the inputs should be the same.
99101 )DOC" );
100102 }
101103};
0 commit comments