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

Method RunInstantiated

tensorflow/core/kernels/data/captured_function.cc:711–745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711Status InstantiatedCapturedFunction::RunInstantiated(
712 const std::vector<Tensor>& args, std::vector<Tensor>* rets) {
713 auto& info = captured_func_->short_circuit_info();
714 if (!info.indices.empty()) {
715 return RunShortCircuit(info, args, captured_func_, rets);
716 }
717
718 FunctionLibraryRuntime::Options f_opts;
719 ScopedStepContainer step_container(
720 f_opts.step_id, [this](const string& name) {
721 lib_->device()->resource_manager()->Cleanup(name).IgnoreError();
722 });
723 f_opts.step_container = &step_container;
724 f_opts.runner = &captured_runner_;
725 f_opts.create_rendezvous = ShouldCreateRendezvous();
726 CancellationManager cancellation_manager;
727 f_opts.cancellation_manager = &cancellation_manager;
728 std::function<void()> deregister_fn;
729 TF_RETURN_IF_ERROR(ConnectCancellationManagers(
730 cancellation_manager_, &cancellation_manager, &deregister_fn));
731 auto cleanup = gtl::MakeCleanup(std::move(deregister_fn));
732
733 BorrowedArgsCallFrame frame(args, &captured_func_->captured_inputs(),
734 ret_types_);
735 Notification n;
736 Status s;
737
738 lib_->Run(f_opts, f_handle_, &frame, [&n, &s](Status func_status) {
739 s.Update(func_status);
740 n.Notify();
741 });
742 n.WaitForNotification();
743 TF_RETURN_IF_ERROR(s);
744 return frame.ConsumeRetvals(rets);
745}
746
747void InstantiatedCapturedFunction::RunAsync(
748 IteratorContext* ctx, std::vector<Tensor>&& args, std::vector<Tensor>* rets,

Callers 2

~IteratorMethod · 0.45
GetNextInternalMethod · 0.45

Calls 13

RunShortCircuitFunction · 0.85
emptyMethod · 0.45
IgnoreErrorMethod · 0.45
CleanupMethod · 0.45
resource_managerMethod · 0.45
deviceMethod · 0.45
captured_inputsMethod · 0.45
RunMethod · 0.45
UpdateMethod · 0.45
NotifyMethod · 0.45
WaitForNotificationMethod · 0.45

Tested by

no test coverage detected