Skip to content

Commit

Permalink
identity doc (PaddlePaddle#3691)
Browse files Browse the repository at this point in the history
* identity doc

* update

* update

* update_overview

* update_overview
  • Loading branch information
shiyutang authored Feb 10, 2022
1 parent ced12fb commit fb65e47
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/api/paddle/nn/Identity_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. _cn_api_paddle_nn_layer_common_Identity:

Identity
-------------------------------

.. py:class:: paddle.nn.Identity(*args, **kwargs)
**等效层** 。对于输入Tensor :math:`X` ,计算公式为:

.. math::
Out = X
参数
:::::::::

- **args** - 任意的参数(没有使用)
- **kwargs** – 任意的关键字参数(没有使用)

形状
:::::::::

- 输入:形状为 :math:`[batch\_size, n1, n2, ...]` 的多维Tensor。
- 输出:形状为 :math:`[batch\_size, n1, n2, ...]` 的多维Tensor。

代码示例
:::::::::

.. code-block:: python
import paddle
input_tensor = paddle.randn(shape=[3, 2])
layer = paddle.nn.Identity()
out = layer(input_tensor)
# input_tensor: [[-0.32342386 -1.200079 ]
# [ 0.7979031 -0.90978354]
# [ 0.40597573 1.8095392 ]]
# out: [[-0.32342386 -1.200079 ]
# [ 0.7979031 -0.90978354]
# [ 0.40597573 1.8095392 ]]
2 changes: 2 additions & 0 deletions docs/api/paddle/nn/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,10 @@ Clip相关
" :ref:`paddle.nn.dynamic_decode <cn_api_paddle_nn_dynamic_decode>` ", "循环解码"
" :ref:`paddle.nn.Flatten <cn_api_tensor_Flatten>` ", "将一个连续维度的Tensor展平成一维Tensor"
" :ref:`paddle.nn.PairwiseDistance <cn_api_nn_PairwiseDistance>` ", "计算两个向量之间pairwise的距离"
" :ref:`paddle.nn.Identity <cn_api_paddle_nn_layer_common_Identity>` ", "建立等效层,作为输入的 Placeholder"
" :ref:`paddle.nn.Unfold <cn_api_fluid_layers_unfold>` ", "实现的功能与卷积中用到的im2col函数一样,通常也被称作为im2col过程"


.. _convolution_functional:

卷积相关函数
Expand Down

0 comments on commit fb65e47

Please sign in to comment.