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

假装没事ソ 提交于 2019-12-19 02:54:09

问题


If I use

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

m batches or m samples will be prefetched?


回答1:


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.



来源:https://stackoverflow.com/questions/49707062/tensorflow-dataset-api-dataset-batchn-prefetchm-prefetches-m-batches-or-sam

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!