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

Method Init

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

Source from the content-addressed store, hash-verified

764
765 private:
766 void Init(OpKernelContext* ctx, const DoneCallback& done) {
767 IteratorResource* iterator = nullptr;
768 ContainerInfo cinfo;
769 Status s = TryInit(ctx, &iterator, &cinfo);
770
771 std::vector<std::pair<OpKernelContext*, DoneCallback>> callbacks_to_run;
772 {
773 mutex_lock l(mu_);
774 if (s.ok()) {
775 iterator_resource_ = iterator;
776 cinfo_ = cinfo;
777 }
778 initialization_status_ = s;
779 std::swap(done_callbacks_, callbacks_to_run);
780 }
781
782 for (auto&& ctx_done : callbacks_to_run) {
783 ProduceOutput(ctx_done.first, ctx_done.second);
784 }
785 ProduceOutput(ctx, done);
786 }
787
788 Status TryInit(OpKernelContext* ctx, IteratorResource** iterator,
789 ContainerInfo* cinfo) {

Callers 6

LOCKS_EXCLUDEDFunction · 0.45
TryInitMethod · 0.45
WriteDataToFileFunction · 0.45
RunAsyncMethod · 0.45
SnapshotWriterMethod · 0.45
LOCKS_EXCLUDEDMethod · 0.45

Calls 1

okMethod · 0.45

Tested by 1

WriteDataToFileFunction · 0.36