tf_dataset.py 文件源码

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

项目:kaggle_redefining_cancer_treatment 作者: jorgemf 项目源码 文件源码
def _map(self, example_serialized, features=None):
        """
        Maps a example_serialized read from the dataset into the final set of tf.Tensors
        to return to the model.

        Simple example:

        def _parse(line, features=None):
            a, b = [np.int32(x) for x in line.split()]
            return a, b

        t_input, t_ouptut = tf.py_func(_parse, [line], [tf.int32, tf.int32],
                                       stateful=True, name='py_parse_example')
        t_ouptut = tf.add(t_ouptut, 1)

        return t_input, t_ouptut

        :param example_serialized: the example serialized
        :param features: do not use this as it is deprecated after 1.2
        :return: a tuple of the tensors to return when get_next is called. Usually (inputs,outputs)
        """
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号