通过阅读 github.com/tensorflow/models/tree/master/tutorials/rnn/ptb
在ptb_word_lm.py
文件,看到最终模型输入存在class PTBInput
里,
进而追踪到reader.py
文件的ptb_producer
方法最后明显就是一句话错位作为RNN的输入
x = tf.strided_slice(data, [0, i * num_steps],
[batch_size, (i + 1) * num_steps])
y = tf.strided_slice(data, [0, i * num_steps + 1],
[batch_size, (i + 1) * num_steps + 1])