from tensorflow.contrib.rnn.python.ops import core_rnn

        ]
        initializer = init_ops.random_uniform_initializer(-0.01, 0.01, seed=127)

        cell = rnn_cell.LSTMCell(
            num_units=num_units, initializer=initializer, state_is_tuple=True)
        multi_cell = rnn_cell.MultiRNNCell(
            [cell() for _ in range(num_layers)])
        outputs, final_state = core_rnn.static_rnn(
            multi_cell, inputs, dtype=dtypes.float32)
        trainable_variables = ops.get_collection(
            ops.GraphKeys.TRAINABLE_VARIABLES)
        gradients = gradients_impl.gradients([outputs, final_state],
                                             trainable_variables)
        training_op = control_flow_ops.group(*gradients)
