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

Method RunWithBorrowedArgs

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

Source from the content-addressed store, hash-verified

672}
673
674Status InstantiatedCapturedFunction::RunWithBorrowedArgs(
675 IteratorContext* ctx, const std::vector<Tensor>& args,
676 std::vector<Tensor>* rets) const {
677 auto& info = captured_func_->short_circuit_info();
678 if (!info.indices.empty()) {
679 return RunShortCircuit(info, args, captured_func_, rets);
680 }
681
682 FunctionLibraryRuntime::Options f_opts;
683 ScopedStepContainer step_container(
684 f_opts.step_id, [this](const string& name) {
685 lib_->device()->resource_manager()->Cleanup(name).IgnoreError();
686 });
687 f_opts.step_container = &step_container;
688 f_opts.runner = ctx->runner();
689 f_opts.create_rendezvous = ShouldCreateRendezvous();
690 CancellationManager cancellation_manager;
691 f_opts.cancellation_manager = &cancellation_manager;
692 std::function<void()> deregister_fn;
693 TF_RETURN_IF_ERROR(ConnectCancellationManagers(
694 cancellation_manager_, &cancellation_manager, &deregister_fn));
695 auto cleanup = gtl::MakeCleanup(std::move(deregister_fn));
696
697 BorrowedArgsCallFrame frame(args, &captured_func_->captured_inputs(),
698 ret_types_);
699 Notification n;
700 Status s;
701
702 lib_->Run(f_opts, f_handle_, &frame, [&n, &s](Status func_status) {
703 s.Update(func_status);
704 n.Notify();
705 });
706 n.WaitForNotification();
707 TF_RETURN_IF_ERROR(s);
708 return frame.ConsumeRetvals(rets);
709}
710
711Status InstantiatedCapturedFunction::RunInstantiated(
712 const std::vector<Tensor>& args, std::vector<Tensor>* rets) {

Callers 6

GetNextInternalMethod · 0.80
GetNextInternalMethod · 0.80
GetNextInternalMethod · 0.80
GetNextInternalMethod · 0.80
GetNextInternalMethod · 0.80

Calls 14

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

Tested by

no test coverage detected