def _array_to_tuple(inputs, size, shape=None):
""" Convert tf.TensorArray to tf.Tuple. """
with tf.variable_scope('array_to_tuple'):
if shape is None:
output = tf.tuple([inputs.read(i) for i in range(size)])
else:
output = tf.tuple([tf.reshape(inputs.read(i), shape) for i in range(size)])
return output
评论列表
文章目录