@ -65,7 +65,8 @@ class SequenceConcatOpMaker : public framework::OpProtoAndCheckerMaker {
"If the level is 0, the inputs will be joined at the nested "
"sequence level."
"If the level is 1, the inputs will be joined at the "
"sequence level.")
"The level should be less than the levels of input")
.SetDefault(0);
AddComment(R"DOC(
The sequence_concat operator concatenates multiple LoDTensors.
@ -77,6 +77,9 @@ class SequenceConcatOpKernel : public framework::OpKernel<T> {
"LoDTensors should be the same.");
}
PADDLE_ENFORCE_GT(ins[0]->NumLevels(), level,
"The levels of all the input LoDTensors "
"should be greater than the specify level");
out->mutable_data<T>(ctx.GetPlace());
auto out_lod = concatLoD<LoDTensor>(ins, axis, level);