Tensorflow Dataset API: dataset.batch(n).prefetch(m) prefetches m batches or samples?

后端 未结 1 967
天涯浪人
天涯浪人 2020-12-31 18:07

If I use

dataset.batch(n).prefetch(m), 

m batches or m samples will be prefetched?

相关标签:
1条回答
  • 2020-12-31 18:22

    The Dataset.prefetch(m) transformation prefetches m elements of its direct input. In this case, since its direct input is dataset.batch(n) and each element of that dataset is a batch (of n elements), it will prefetch m batches.

    0 讨论(0)
提交回复
热议问题