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

Method GetNext

tensorflow/core/kernels/data/iterator_ops.cc:63–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61} // namespace
62
63Status IteratorResource::GetNext(OpKernelContext* ctx,
64 std::vector<Tensor>* out_tensors,
65 bool* end_of_sequence) {
66 std::shared_ptr<State> captured_state;
67 {
68 tf_shared_lock l(mu_);
69 captured_state = iterator_state_;
70 }
71 if (captured_state->iterator) {
72 IteratorContext::Params params(ctx);
73 params.flr = captured_state->flr;
74 params.function_handle_cache = captured_state->function_handle_cache.get();
75 params.resource_mgr = &captured_state->resource_mgr;
76 params.thread_factory = unbounded_thread_pool_.get_thread_factory();
77 params.thread_pool = &unbounded_thread_pool_;
78 params.cancellation_manager = &captured_state->cancellation_manager;
79 std::function<void()> deregister_fn;
80 TF_RETURN_IF_ERROR(ConnectCancellationManagers(ctx->cancellation_manager(),
81 params.cancellation_manager,
82 &deregister_fn));
83 auto cleanup = gtl::MakeCleanup(std::move(deregister_fn));
84 return captured_state->iterator->GetNext(IteratorContext(std::move(params)),
85 out_tensors, end_of_sequence);
86 }
87 return errors::FailedPrecondition(
88 "GetNext() failed because the iterator has not been initialized. Ensure "
89 "that you have run the initializer operation for this iterator before "
90 "getting the next element.");
91}
92
93Status IteratorResource::Save(SerializationContext* ctx,
94 IteratorStateWriter* writer) {

Callers 15

TEST_PFunction · 0.45
TEST_FFunction · 0.45
TEST_PFunction · 0.45
TEST_PFunction · 0.45
TEST_PFunction · 0.45
GetNextInternalMethod · 0.45
TEST_PFunction · 0.45
TEST_PFunction · 0.45
TEST_PFunction · 0.45
GetNextInternalMethod · 0.45
GetNextInternalMethod · 0.45
GetNextInternalMethod · 0.45

Calls 6

FailedPreconditionFunction · 0.85
get_thread_factoryMethod · 0.80
IteratorContextClass · 0.50
getMethod · 0.45
cancellation_managerMethod · 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_PFunction · 0.36
TEST_PFunction · 0.36
TEST_PFunction · 0.36
TEST_PFunction · 0.36
TEST_PFunction · 0.36
TEST_PFunction · 0.36