未验证 提交 e92b8d19 编写于 作者: W wawltor 提交者: GitHub

Fix fluid.data code example in sz tool part 1. (#1478)

test=develop
test=document_preview
上级 3acf9935
...@@ -19,8 +19,8 @@ rank ...@@ -19,8 +19,8 @@ rank
.. code-block:: python .. code-block:: python
import paddle.fluid as fluid import paddle.fluid as fluid
input = fluid.layers.data( input = fluid.data(
name="input", shape=[3, 100, 100], dtype="float32") name="input", shape=[3, 100, 100], dtype="float32")
rank = fluid.layers.rank(input) # rank=(3,) rank = fluid.layers.rank(input) # rank=(4,)
...@@ -28,6 +28,6 @@ rsqrt ...@@ -28,6 +28,6 @@ rsqrt
.. code-block:: python .. code-block:: python
import paddle.fluid as fluid import paddle.fluid as fluid
data = fluid.layers.data(name="input", shape=[32, 784]) data = fluid.data(name="input", shape=[32, 784])
result = fluid.layers.rsqrt(data) result = fluid.layers.rsqrt(data)
...@@ -21,6 +21,6 @@ zeros_like ...@@ -21,6 +21,6 @@ zeros_like
.. code-block:: python .. code-block:: python
import paddle.fluid as fluid import paddle.fluid as fluid
x = fluid.layers.data(name='x', dtype='float32', shape=[3], append_batch_size=False) x = fluid.data(name='x', dtype='float32', shape=[3])
data = fluid.layers.zeros_like(x) # [0.0, 0.0, 0.0] data = fluid.layers.zeros_like(x) # [0.0, 0.0, 0.0]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册