提交 28451956 编写于 作者: C chengduoZH

add doc

上级 f8c55fb2
......@@ -38,9 +38,13 @@ class SeqConcatShapeInferer : public framework::InferShapeBase {
public:
void operator()(framework::InferShapeContext *context) const override {
try {
PADDLE_ENFORCE(context->HasInputs("X"));
PADDLE_ENFORCE(context->HasOutput("Out"));
PADDLE_ENFORCE(context->HasInputs("X"),
"Input(X) of Sequence Concat Op should not be null.");
PADDLE_ENFORCE(context->HasOutput("Out"),
"Output(Out) of Sequence Concat Op should not be null.");
PADDLE_ENFORCE_GT(context->HasInputs("X"), 1,
"The number of input sequences is at least two.");
auto x_dims = context->GetInputsDim("X");
int64_t batch_size = 0;
int64_t feature_size = 0;
......
......@@ -1781,6 +1781,31 @@ def sequence_pool(input, pool_type):
return pool_out
@templatedoc()
def sequence_concat(input, name=None):
"""
${comment}
Args:
input(list): List of Variables to be concatenated.
name(str|None): A name for this layer(optional). If set None, the layer
will be named automatically.
Returns:
Variable: Output variable of the concatenation.
Examples:
.. code-block:: python
out = fluid.layers.sequence_concat(input=[seq1, seq2, seq3])
"""
helper = LayerHelper('sequence_concat', **locals())
out = helper.create_tmp_variable(dtype=helper.input_dtype())
helper.append_op(
type='sequence_concat', inputs={'X': input}, outputs={'Out': [out]})
return out
def sequence_first_step(input):
"""
This function gets the first step of sequence.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册