Creates a `Dataset` that prefetches elements from this dataset. Note: Like other `Dataset` methods, prefetch operates on the elements of the input dataset. It has no concept of examples vs. batches. `examples.prefetch(2)` will prefetch two elements (2 examples), while `examples.batc
(self, buffer_size)
| 821 | return ConcatenateDataset(self, dataset) |
| 822 | |
| 823 | def prefetch(self, buffer_size): |
| 824 | """Creates a `Dataset` that prefetches elements from this dataset. |
| 825 | |
| 826 | Note: Like other `Dataset` methods, prefetch operates on the |
| 827 | elements of the input dataset. It has no concept of examples vs. batches. |
| 828 | `examples.prefetch(2)` will prefetch two elements (2 examples), |
| 829 | while `examples.batch(20).prefetch(2)` will prefetch 2 elements |
| 830 | (2 batches, of 20 examples each). |
| 831 | |
| 832 | Args: |
| 833 | buffer_size: A `tf.int64` scalar `tf.Tensor`, representing the maximum |
| 834 | number of elements that will be buffered when prefetching. |
| 835 | |
| 836 | Returns: |
| 837 | Dataset: A `Dataset`. |
| 838 | """ |
| 839 | return PrefetchDataset(self, buffer_size) |
| 840 | |
| 841 | @staticmethod |
| 842 | def list_files(file_pattern, shuffle=None, seed=None): |