From 7459c1c22261f8cc4be8b3a9f702096c9e92bf6c Mon Sep 17 00:00:00 2001 From: wawltor Date: Mon, 6 Jul 2020 10:15:37 +0800 Subject: [PATCH] Fix the doc example for some ops Fix the doc examples for those apis --- doc/fluid/api_cn/layers_cn/deformable_roi_pooling_cn.rst | 4 ++-- doc/fluid/api_cn/layers_cn/elementwise_add_cn.rst | 2 +- doc/fluid/api_cn/layers_cn/elementwise_div_cn.rst | 2 +- doc/fluid/api_cn/layers_cn/elementwise_mul_cn.rst | 2 +- doc/fluid/api_cn/layers_cn/elementwise_sub_cn.rst | 2 +- doc/fluid/api_cn/layers_cn/scale_cn.rst | 2 +- doc/fluid/api_cn/layers_cn/unique_cn.rst | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/fluid/api_cn/layers_cn/deformable_roi_pooling_cn.rst b/doc/fluid/api_cn/layers_cn/deformable_roi_pooling_cn.rst index e1b19b7ac..bcccb58ca 100644 --- a/doc/fluid/api_cn/layers_cn/deformable_roi_pooling_cn.rst +++ b/doc/fluid/api_cn/layers_cn/deformable_roi_pooling_cn.rst @@ -48,7 +48,7 @@ deformable_roi_pooling .. code-block:: python - #position_sensitive为False + #position_sensitive=False import paddle.fluid as fluid input = fluid.data(name="input", @@ -74,7 +74,7 @@ deformable_roi_pooling trans_std=0.1, position_sensitive=False) - #position_sensitive为True + #position_sensitive=True import paddle.fluid as fluid input = fluid.data(name="input", diff --git a/doc/fluid/api_cn/layers_cn/elementwise_add_cn.rst b/doc/fluid/api_cn/layers_cn/elementwise_add_cn.rst index 91b9cece8..7414eae16 100644 --- a/doc/fluid/api_cn/layers_cn/elementwise_add_cn.rst +++ b/doc/fluid/api_cn/layers_cn/elementwise_add_cn.rst @@ -107,7 +107,7 @@ elementwise_add "y": np.random.randint(1, 5, size=[5]).astype('float32') } x = fluid.layers.data(name="x", shape=[2,3,4,5], dtype='float32') - y = fluid.layers.data(name="y", shape=[3,4], dtype='float32') + y = fluid.layers.data(name="y", shape=[5], dtype='float32') # z = x + y z = fluid.layers.elementwise_add(x, y, axis=3) place = fluid.CPUPlace() diff --git a/doc/fluid/api_cn/layers_cn/elementwise_div_cn.rst b/doc/fluid/api_cn/layers_cn/elementwise_div_cn.rst index a5b7544d3..d4d12f36b 100644 --- a/doc/fluid/api_cn/layers_cn/elementwise_div_cn.rst +++ b/doc/fluid/api_cn/layers_cn/elementwise_div_cn.rst @@ -107,7 +107,7 @@ elementwise_div "y": np.random.randint(1, 5, size=[5]).astype('float32') } x = fluid.layers.data(name="x", shape=[2,3,4,5], dtype='float32') - y = fluid.layers.data(name="y", shape=[3,4], dtype='float32') + y = fluid.layers.data(name="y", shape=[5], dtype='float32') z = fluid.layers.elementwise_div(x, y, axis=3) # z = x / y place = fluid.CPUPlace() diff --git a/doc/fluid/api_cn/layers_cn/elementwise_mul_cn.rst b/doc/fluid/api_cn/layers_cn/elementwise_mul_cn.rst index 1ba52febf..9966144b9 100644 --- a/doc/fluid/api_cn/layers_cn/elementwise_mul_cn.rst +++ b/doc/fluid/api_cn/layers_cn/elementwise_mul_cn.rst @@ -107,7 +107,7 @@ elementwise_mul "y": np.random.randint(1, 5, size=[5]).astype('float32') } x = fluid.layers.data(name="x", shape=[2,3,4,5], dtype='float32') - y = fluid.layers.data(name="y", shape=[3,4], dtype='float32') + y = fluid.layers.data(name="y", shape=[5], dtype='float32') z = fluid.layers.elementwise_mul(x, y, axis=3) # z = x * y place = fluid.CPUPlace() diff --git a/doc/fluid/api_cn/layers_cn/elementwise_sub_cn.rst b/doc/fluid/api_cn/layers_cn/elementwise_sub_cn.rst index 7bd8ac5e0..c5886ad2e 100644 --- a/doc/fluid/api_cn/layers_cn/elementwise_sub_cn.rst +++ b/doc/fluid/api_cn/layers_cn/elementwise_sub_cn.rst @@ -107,7 +107,7 @@ elementwise_sub "y": np.random.randint(1, 5, size=[5]).astype('float32') } x = fluid.layers.data(name="x", shape=[2,3,4,5], dtype='float32') - y = fluid.layers.data(name="y", shape=[3,4], dtype='float32') + y = fluid.layers.data(name="y", shape=[5], dtype='float32') z = fluid.layers.elementwise_sub(x, y, axis=3) # z = x - y place = fluid.CPUPlace() diff --git a/doc/fluid/api_cn/layers_cn/scale_cn.rst b/doc/fluid/api_cn/layers_cn/scale_cn.rst index f9ddd81f8..6623f9e45 100644 --- a/doc/fluid/api_cn/layers_cn/scale_cn.rst +++ b/doc/fluid/api_cn/layers_cn/scale_cn.rst @@ -62,7 +62,7 @@ scale import numpy as np inputs = fluid.layers.data(name="x", shape=[2, 3], dtype='float32') - scale = fluid.layers.data(name="scale", shape=[1], dtype='float32' + scale = fluid.layers.data(name="scale", shape=[1], dtype='float32', append_batch_size=False) output = fluid.layers.scale(inputs, scale = scale, bias = 1.0) diff --git a/doc/fluid/api_cn/layers_cn/unique_cn.rst b/doc/fluid/api_cn/layers_cn/unique_cn.rst index 6dcf44005..0877f8686 100644 --- a/doc/fluid/api_cn/layers_cn/unique_cn.rst +++ b/doc/fluid/api_cn/layers_cn/unique_cn.rst @@ -27,7 +27,7 @@ unique为 ``x`` 返回一个unique张量和一个指向该unique张量的索引 import numpy as np import paddle.fluid as fluid - x = fluid.assign(np.array([2, 3, 3, 1, 5, 3], dtype='int32')) + x = fluid.layers.assign(np.array([2, 3, 3, 1, 5, 3], dtype='int32')) out, index = fluid.layers.unique(x) # out is [2, 3, 1, 5]; index is [0, 1, 1, 2, 3, 1] -- GitLab