提交 3528e6ed 编写于 作者: A Abhinav Arora 提交者: kavyasrinet

Polish API docs for Fluid Assign and Concat layer (#6855)

* Polish API docs for assign layer

* Polishing the API docs for concat and assign layer
上级 e473fa6b
...@@ -27,10 +27,23 @@ def cast(x, dtype): ...@@ -27,10 +27,23 @@ def cast(x, dtype):
return out return out
def concat(input, axis): def concat(input, axis=0):
""" """
This function concats the input along the axis mentioned **Concat**
This function concatenates the input along the axis mentioned
and returns that as the output. and returns that as the output.
Args:
input(list): List of tensors to be concatenated
axis(int): Integer axis along which the tensors will be concatenated
Returns:
Variable: Output variable of the concatenation
Examples:
.. code-block:: python
out = fluid.layers.concat(input=[Efirst, Esecond, Ethird, Efourth])
""" """
helper = LayerHelper('concat', **locals()) helper = LayerHelper('concat', **locals())
out = helper.create_tmp_variable(dtype=helper.input_dtype()) out = helper.create_tmp_variable(dtype=helper.input_dtype())
...@@ -55,6 +68,24 @@ def sums(input, out=None): ...@@ -55,6 +68,24 @@ def sums(input, out=None):
def assign(input, output): def assign(input, output):
"""
**Assign**
This function copies the *input* Variable to the *output* Variable.
Args:
input(Variable): The source variable
output(Variable): The destination variable
Returns:
Variable: The destination variable that was supplied as the *output*.
Examples:
.. code-block:: python
out = fluid.layers.create_tensor(dtype='float32')
hidden = fluid.layers.fc(input=data, size=10)
fluid.layers.assign(hidden, out)
"""
helper = LayerHelper('assign', **locals()) helper = LayerHelper('assign', **locals())
helper.append_op( helper.append_op(
type='scale', type='scale',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册