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

Method MakeIterator

tensorflow/core/framework/dataset.h:685–696  ·  view source on GitHub ↗

Returns a new iterator for iterating over the range of elements in this dataset. This method may be called multiple times on the same instance, and the resulting iterators will have distinct state. Each iterator will traverse all elements in this dataset from the start. The prefix identifies the sequence of iterators leading up to the newly created iterator.

Source from the content-addressed store, hash-verified

683 // The prefix identifies the sequence of iterators leading up to the newly
684 // created iterator.
685 Status MakeIterator(IteratorContext* ctx, const string& output_prefix,
686 std::unique_ptr<IteratorBase>* iterator) const {
687 *iterator = MakeIteratorInternal(output_prefix);
688 if (const auto& model = ctx->model()) {
689 const string& prefix = (*iterator)->prefix();
690 (*iterator)->SetNode(model->AddNode(MakeNodeFactory(ctx, iterator->get()),
691 prefix, output_prefix));
692 (*iterator)->AddCleanupFunction(
693 [model, prefix]() { model->RemoveNode(prefix); });
694 }
695 return (*iterator)->Initialize(ctx);
696 }
697
698 Status MakeIterator(IteratorContext&& ctx, const string& output_prefix,
699 std::unique_ptr<IteratorBase>* iterator) const {

Callers 15

ComputeAsyncMethod · 0.45
InitializeMethod · 0.45
TEST_PFunction · 0.45
TEST_FFunction · 0.45
TEST_PFunction · 0.45
TEST_PFunction · 0.45
TEST_PFunction · 0.45
InitializeMethod · 0.45
TEST_PFunction · 0.45
TEST_FFunction · 0.45
TEST_PFunction · 0.45
TEST_FFunction · 0.45

Calls 9

MakeIteratorFunction · 0.85
prefixMethod · 0.80
SetNodeMethod · 0.80
AddCleanupFunctionMethod · 0.80
modelMethod · 0.45
AddNodeMethod · 0.45
getMethod · 0.45
RemoveNodeMethod · 0.45
InitializeMethod · 0.45

Tested by 15

TEST_PFunction · 0.36
TEST_FFunction · 0.36
TEST_PFunction · 0.36
TEST_PFunction · 0.36
TEST_PFunction · 0.36
TEST_PFunction · 0.36
TEST_FFunction · 0.36
TEST_PFunction · 0.36
TEST_FFunction · 0.36
InitializeMethod · 0.36
TEST_PFunction · 0.36
TEST_PFunction · 0.36