什么是tensorflow.python.data.ops.dataset_ops.PrefetchDataset?

use*_*129 6 tensorflow

我遇到了一些以tensorflow.python.data.ops.dataset_ops.PrefetchDataset. 如果我说实话的话。我真的不明白这是如何打破过去的dataopsdataset_ops和一般意味着什么PrefetchDataset(如果有的话)

Hyu*_*Lee 5

它可能与tf.raw_ops.PrefetchDataset有关:
它似乎是一个从预取数据集中异步返回元素的操作。

例如,如果object_x是以下类型:

<PrefetchDataset shapes: ((), ()), types: (tf.string, tf.int64)>
Run Code Online (Sandbox Code Playgroud)

它是可迭代的;

for string_, int_ in object_x:
    print(string_)
Run Code Online (Sandbox Code Playgroud)

但是,PrefetchDataset对象看起来不是迭代器