美文网首页
Dataset.shard记录

Dataset.shard记录

作者: 飞奔的卤蛋 | 来源:发表于2018-08-02 12:52 被阅读0次

    Dataset.shard官方文档

    Distributed TensorFlow

    Here is an example with 3 workers.

    dataset = tf.data.Dataset.range(6)

    dataset = dataset.shard(FLAGS.num_workers, FLAGS.worker_index)

    iterator = dataset.make_one_shot_iterator()

    res = iterator.get_next()

    #Suppose you have 3 workers in total

        with tf.Session() as sess:

            for i in range(2):

                print(sess.run(res))

    We will have the output:

    0, 3 on worker 0

    1, 4 on worker 1

    2, 5 on worker 2

    相关文章

      网友评论

          本文标题:Dataset.shard记录

          本文链接:https://www.haomeiwen.com/subject/xbvjvftx.html