tf_dataset.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:kaggle_redefining_cancer_treatment 作者: jorgemf 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号