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

Method Run

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

Source from the content-addressed store, hash-verified

636InstantiatedCapturedFunction::~InstantiatedCapturedFunction() {}
637
638Status InstantiatedCapturedFunction::Run(IteratorContext* ctx,
639 std::vector<Tensor>&& args,
640 std::vector<Tensor>* rets) const {
641 auto& info = captured_func_->short_circuit_info();
642 if (!info.indices.empty()) {
643 return RunShortCircuit(info, std::move(args), captured_func_, rets);
644 }
645
646 FunctionLibraryRuntime::Options f_opts;
647 ScopedStepContainer step_container(
648 f_opts.step_id, [this](const string& name) {
649 lib_->device()->resource_manager()->Cleanup(name).IgnoreError();
650 });
651 f_opts.step_container = &step_container;
652 f_opts.runner = ctx->runner();
653 f_opts.create_rendezvous = ShouldCreateRendezvous();
654 CancellationManager cancellation_manager;
655 f_opts.cancellation_manager = &cancellation_manager;
656 std::function<void()> deregister_fn;
657 TF_RETURN_IF_ERROR(ConnectCancellationManagers(
658 cancellation_manager_, &cancellation_manager, &deregister_fn));
659 auto cleanup = gtl::MakeCleanup(std::move(deregister_fn));
660
661 OwnedArgsCallFrame frame(std::move(args), &captured_func_->captured_inputs(),
662 ret_types_);
663 Notification n;
664 Status s;
665 lib_->Run(f_opts, f_handle_, &frame, [&n, &s](Status func_status) {
666 s.Update(func_status);
667 n.Notify();
668 });
669 n.WaitForNotification();
670 TF_RETURN_IF_ERROR(s);
671 return frame.ConsumeRetvals(rets);
672}
673
674Status InstantiatedCapturedFunction::RunWithBorrowedArgs(
675 IteratorContext* ctx, const std::vector<Tensor>& args,

Callers 15

RunFusedGraphFunction · 0.45
ComputeAsyncMethod · 0.45
TryInitMethod · 0.45
RunFunctionMethod · 0.45
GetNextInternalMethod · 0.45
ComputeMethod · 0.45
RewriteDatasetFunction · 0.45
RunWithBorrowedArgsMethod · 0.45
RunInstantiatedMethod · 0.45
RunAsyncMethod · 0.45
ComputeAsyncMethod · 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
runnerMethod · 0.45
captured_inputsMethod · 0.45
UpdateMethod · 0.45
NotifyMethod · 0.45
WaitForNotificationMethod · 0.45

Tested by 2

RunFusedGraphFunction · 0.36
RunFunctionMethod · 0.36