From bf1b4bb6f16dea31f8bfe3d131b6e0d0875b9694 Mon Sep 17 00:00:00 2001 From: Xing Wu Date: Wed, 29 Apr 2020 12:07:30 +0800 Subject: [PATCH] fix doc errors, test=develop (#2023) --- doc/fluid/api_cn/layers_cn/GRUCell_cn.rst | 2 +- doc/fluid/api_cn/layers_cn/lstm_cn.rst | 2 +- doc/fluid/api_cn/layers_cn/lstm_unit_cn.rst | 26 +++++++-------------- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/doc/fluid/api_cn/layers_cn/GRUCell_cn.rst b/doc/fluid/api_cn/layers_cn/GRUCell_cn.rst index 3acb79d73..347f5a48b 100644 --- a/doc/fluid/api_cn/layers_cn/GRUCell_cn.rst +++ b/doc/fluid/api_cn/layers_cn/GRUCell_cn.rst @@ -35,7 +35,7 @@ GRUCell .. code-block:: python import paddle.fluid.layers as layers - cell = layers.rnn.GRUCell(hidden_size=256) + cell = layers.GRUCell(hidden_size=256) .. py:method:: call(inputs, states) diff --git a/doc/fluid/api_cn/layers_cn/lstm_cn.rst b/doc/fluid/api_cn/layers_cn/lstm_cn.rst index 87ff8fdce..2a0fe9b08 100644 --- a/doc/fluid/api_cn/layers_cn/lstm_cn.rst +++ b/doc/fluid/api_cn/layers_cn/lstm_cn.rst @@ -10,7 +10,7 @@ lstm .. note:: 该OP仅支持 GPU 设备运行 -该OP实现了 LSTM,即 Long-Short Term Memory(长短期记忆)运算 - `Hochreiter, S., & Schmidhuber, J. (1997) `_。 +该OP实现了 LSTM,即 Long-Short Term Memory(长短期记忆)运算 - `Hochreiter, S., & Schmidhuber, J. (1997) `_。 该OP的实现不包括 diagonal/peephole 连接,参见 `Gers, F. A., & Schmidhuber, J. (2000) `_。 如果需要使用 peephole 连接方法,请使用 :ref:`cn_api_fluid_layers_dynamic_lstm` 。 diff --git a/doc/fluid/api_cn/layers_cn/lstm_unit_cn.rst b/doc/fluid/api_cn/layers_cn/lstm_unit_cn.rst index e24a932b3..9e0642e08 100644 --- a/doc/fluid/api_cn/layers_cn/lstm_unit_cn.rst +++ b/doc/fluid/api_cn/layers_cn/lstm_unit_cn.rst @@ -48,26 +48,18 @@ Long-Short Term Memory(LSTM)循环神经网络计算单元。该OP用于完 **代码示例**: .. code-block:: python - + import paddle.fluid as fluid - + dict_dim, emb_dim, hidden_dim = 128, 64, 512 - data = fluid.layers.data(name='step_data', shape=[1], dtype='int32') - x = fluid.layers.embedding(input=data, size=[dict_dim, emb_dim]) - pre_hidden = fluid.layers.data(name='pre_hidden', shape=[hidden_dim], dtype='float32') - pre_cell = fluid.layers.data(name='pre_cell', shape=[hidden_dim], dtype='float32') + data = fluid.data(name='step_data', shape=[None], dtype='int64') + x = fluid.embedding(input=data, size=[dict_dim, emb_dim]) + pre_hidden = fluid.data( + name='pre_hidden', shape=[None, hidden_dim], dtype='float32') + pre_cell = fluid.data( + name='pre_cell', shape=[None, hidden_dim], dtype='float32') hidden = fluid.layers.lstm_unit( x_t=x, hidden_t_prev=pre_hidden, cell_t_prev=pre_cell) - - - - - - - - - - - + -- GitLab