def _flat_map(self, example_serialized, features=None):
"""
Flat maps the example serialized.
Simple example:
def _parse(line):
a, b = [np.int32(x) for x in line.split()]
return [a, a*2, a*3], [b, b*2, b*3]
t_input, t_ouptut = tf.py_func(_parse, [line], [tf.int32, tf.int32],
stateful=True, name='py_parse_example')
v = (t_intput, t_output)
return Dataset.from_tensor_slices(v)
:param example_serialized:
:param features: do not use this as it is deprecated after 1.2
:return: a dataset
"""
pass
# TODO remove features in TF 1.3
tf_dataset.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录