def acquire_data_ops(filename_queue, processing_method, record_defaults=None):
"""
Get the line/lines from the files in the given filename queue,
read/decode them, and give them to the given method for processing
the information.
"""
with tf.name_scope("acquire_data"):
# with tf.device("/cpu:0"):
if record_defaults is None:
record_defaults = [[""]]
reader = tf.TextLineReader()
key, value = reader.read(filename_queue)
row = tf.decode_csv(value, record_defaults=record_defaults)
#The 3 is because this is used for training and it trains on triplets
return processing_method(row[0], 3), tf.constant(True, dtype=tf.bool)
评论列表
文章目录