diff --git a/doc/fluid/api_cn/layers_cn/GRUCell_cn.rst b/doc/fluid/api_cn/layers_cn/GRUCell_cn.rst index 3acb79d737531d6f2648081c25336d636e119611..347f5a48b8aeb529e0cdfbbc301ffa3ad626b917 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 87ff8fdce4fc62b31465fab912df840a6f9a78de..2a0fe9b082cb31b0352ad1b6bc90823136b9b181 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 e24a932b38afae0e9bb6e24cf0afa5ddd5afff22..9e0642e08748b6b03f1ae00d20a259da9706d6dc 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) - - - - - - - - - - - +