【发布时间】:2025-01-13 10:10:02
【问题描述】:
我关注RNN tutorial of Tensorflow。
我无法理解以下脚本中reader.py 中的function ptb_producer:
with tf.control_dependencies([assertion]):
epoch_size = tf.identity(epoch_size, name="epoch_size")
i = tf.train.range_input_producer(epoch_size, shuffle=False).dequeue()
x = tf.strided_slice(data, [0, i * num_steps],[batch_size, (i + 1) * num_steps])
x.set_shape([batch_size, num_steps])
y = tf.strided_slice(data, [0, i * num_steps + 1],[batch_size, (i + 1) * num_steps + 1])
y.set_shape([batch_size, num_steps])
return x, y
谁能解释tf.train.range_input_producer 在做什么?
【问题讨论】:
标签: python-3.x tensorflow