未验证 提交 b3cfb021 编写于 作者: Z zhulei 提交者: GitHub

Update example codes of ConstantInitializer & MSRAInitializer (#27915)

* Add api of constant in paddle.nn.initializer

* Add api of constant in paddle.nn.initializer

* Add api of constant in paddle.nn.initializer

* Add api of constant in paddle.nn.initializer

* Add api of constant in paddle.nn.initializer

* Add api of constant in paddle.nn.initializer

* Add api of constant in paddle.nn.initializer

* Add api of KaimingUniform & KaimingNormal in paddle.nn.initializer

* Add api of KaimingUniform & KaimingNormal in paddle.nn.initializer

* Add api of KaimingUniform & KaimingNormal in paddle.nn.initializer

* Add api of KaimingUniform & KaimingNormal in paddle.nn.initializer

* Add api of KaimingUniform & KaimingNormal in paddle.nn.initializer

* Add api of KaimingUniform & KaimingNormal in paddle.nn.initializer

* test=document_fix

* test=document_fix
上级 328cb289
......@@ -105,10 +105,14 @@ class ConstantInitializer(Initializer):
Examples:
.. code-block:: python
import paddle.fluid as fluid
import paddle
import paddle.fluid as fluid
paddle.enable_static()
x = fluid.data(name="data", shape=[8, 32, 32], dtype="float32")
fc = fluid.layers.fc(input=x, size=10,
param_attr=fluid.initializer.Constant(value=2.0))
fc = fluid.layers.fc(
input=x,
size=10,
param_attr=fluid.initializer.Constant(value=2.0))
"""
......@@ -623,7 +627,9 @@ class MSRAInitializer(Initializer):
Examples:
.. code-block:: python
import paddle
import paddle.fluid as fluid
paddle.enable_static()
x = fluid.data(name="data", shape=[8, 32, 32], dtype="float32")
fc = fluid.layers.fc(input=x, size=10,
param_attr=fluid.initializer.MSRA(uniform=False))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册