MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / prefetch

Method prefetch

tensorflow/python/data/ops/dataset_ops.py:823–839  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Callers 15

build_model_inputFunction · 0.45
build_model_inputFunction · 0.45
build_model_inputFunction · 0.45
build_model_inputFunction · 0.45
build_model_inputFunction · 0.45
build_model_inputFunction · 0.45
build_model_inputFunction · 0.45
build_model_inputFunction · 0.45
build_model_inputFunction · 0.45
build_model_inputFunction · 0.45
mainFunction · 0.45
as_datasetMethod · 0.45

Calls 1

PrefetchDatasetClass · 0.70

Tested by 15

fnMethod · 0.36
_testFromGeneratorMethod · 0.36
interleave_fnMethod · 0.36
testBufferSizeMethod · 0.36
testInvalidBufferSizeMethod · 0.36
testPrefetchErrorMethod · 0.36