@declarative
def forward(self, input, label, init_hidden, init_cell):
    init_h = fluid.layers.reshape(init_hidden, shape=[self.num_layers, (- 1), self.hidden_size])
    init_c = fluid.layers.reshape(init_cell, shape=[self.num_layers, (- 1), self.hidden_size])
    x_emb = self.embedding(input)
    x_emb = fluid.layers.reshape(x_emb, shape=[(- 1), self.num_steps, self.hidden_size])
    if ((self.dropout is not None) and (self.dropout > 0.0)):
        x_emb = fluid.layers.dropout(x_emb, dropout_prob=self.dropout, dropout_implementation='upscale_in_train')
    (rnn_out, last_hidden, last_cell) = self.simple_lstm_rnn(x_emb, init_h, init_c)
    projection = fluid.layers.matmul(rnn_out, self.softmax_weight)
    projection = fluid.layers.elementwise_add(projection, self.softmax_bias)
    loss = fluid.layers.softmax_with_cross_entropy(logits=projection, label=label, soft_label=False)
    loss = fluid.layers.reshape(loss, shape=[(- 1), self.num_steps])
    loss = fluid.layers.reduce_mean(loss, dim=[0])
    loss = fluid.layers.reduce_sum(loss)
    return (loss, last_hidden, last_cell)
@declarative
def forward(self, input, label, init_hidden, init_cell):
    init_h = fluid.layers.reshape(init_hidden, shape=[self.num_layers, (- 1), self.hidden_size])
    init_c = fluid.layers.reshape(init_cell, shape=[self.num_layers, (- 1), self.hidden_size])
    x_emb = self.embedding(input)
    x_emb = fluid.layers.reshape(x_emb, shape=[(- 1), self.num_steps, self.hidden_size])
    if ((self.dropout is not None) and (self.dropout > 0.0)):
        x_emb = fluid.layers.dropout(x_emb, dropout_prob=self.dropout, dropout_implementation='upscale_in_train')
    (rnn_out, last_hidden, last_cell) = self.simple_lstm_rnn(x_emb, init_h, init_c)
    projection = fluid.layers.matmul(rnn_out, self.softmax_weight)
    projection = fluid.layers.elementwise_add(projection, self.softmax_bias)
    loss = fluid.layers.softmax_with_cross_entropy(logits=projection, label=label, soft_label=False)
    loss = fluid.layers.reshape(loss, shape=[(- 1), self.num_steps])
    loss = fluid.layers.reduce_mean(loss, dim=[0])
    loss = fluid.layers.reduce_sum(loss)
    return (loss, last_hidden, last_cell)