未验证 提交 2b328c41 编写于 作者: D Double_V 提交者: GitHub

fix cn doc of prroi_pool and NumpyArrayInitializer api,test=develop (#2255)

上级 7e4d9df9
...@@ -22,8 +22,9 @@ NumpyArrayInitializer ...@@ -22,8 +22,9 @@ NumpyArrayInitializer
.. code-block:: python .. code-block:: python
import paddle.fluid as fluid import paddle.fluid as fluid
x = fluid.layers.data(name="x", shape=[5], dtype='float32') import numpy
fc = fluid.layers.fc(input=x, size=10, x1 = fluid.data(name="x1", shape=[2, 1], dtype='float32')
fc = fluid.layers.fc(input=x1, size=10,
param_attr=fluid.initializer.NumpyArrayInitializer(numpy.array([1,2]))) param_attr=fluid.initializer.NumpyArrayInitializer(numpy.array([1,2])))
...@@ -34,10 +34,18 @@ PRROIPool运算 ...@@ -34,10 +34,18 @@ PRROIPool运算
.. code-block:: python .. code-block:: python
## prroi_pool without batch_roi_num
import paddle.fluid as fluid import paddle.fluid as fluid
x = fluid.layers.data(name='x', shape=[490, 28, 28], dtype='float32') x = fluid.data(name='x', shape=[None, 490, 28, 28], dtype='float32')
rois = fluid.layers.data(name='rois', shape=[4], lod_level=1, dtype='float32') rois = fluid.data(name='rois', shape=[None, 4], lod_level=1, dtype='float32')
pool_out = fluid.layers.prroi_pool(x, rois, 10, 1.0, 7, 7) pool_out = fluid.layers.prroi_pool(x, rois, 1.0, 7, 7)
## prroi_pool with batch_roi_num
batchsize=4
x2 = fluid.data(name='x2', shape=[batchsize, 490, 28, 28], dtype='float32')
rois2 = fluid.data(name='rois2', shape=[batchsize, 4], dtype='float32')
batch_rois_num = fluid.data(name='rois_nums', shape=[batchsize], dtype='int64')
pool_out2 = fluid.layers.prroi_pool(x2, rois2, 1.0, 7, 7, batch_roi_nums=batch_rois_num)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册