import tensorflow as tf


                result[k] = preds
                losses.append(loss)
                

    return (result,losses)




"""
Test RNN graph multi layer
"""
def test_rnn_kstep_layer(test_data_x,test_data_y, preds, rnn_outputs, g, checkpoint, input_prob, output_prob, state_prob, num_test,  kstep = 3):
    with tf.Session() as sess:
        sess.run(tf.global_variables_initializer())
        result= {}

        "read the trained graph"
        g['saver'].restore(sess, checkpoint)

        losses = []
        for step_num in range(kstep):
            k=step_num+1
         
            for index,(X, Y, YP, S) in enumerate(gen_batch_kstep_layer(test_data_x[k:], test_data_y[k:], preds[:-1],rnn_outputs)):
                
                feed_dict={g['x']: np.dstack((X,YP)), g['y']:Y, g['init_state']: S, g['batch_size']:num_test, g['input_prob']: input_prob,g['output_prob']:output_prob,g['state_prob']:state_prob}
                preds, rnn_outputs= sess.run([g['preds'], g['final_state']], feed_dict)
                
