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

Method ExtendLocked

tensorflow/core/common_runtime/direct_session.cc:983–1007  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

981}
982
983Status DirectSession::ExtendLocked(GraphDef graph) {
984 if (!(flib_def_ && execution_state_)) {
985 // If this is the first call, we can initialize the execution state
986 // with `graph` and do not need to call `Extend()`.
987 // NOTE(mrry): The function library created here will be used for
988 // all subsequent extensions of the graph.
989 flib_def_.reset(
990 new FunctionLibraryDefinition(OpRegistry::Global(), graph.library()));
991 GraphExecutionStateOptions options;
992 options.device_set = &device_set_;
993 options.session_options = &options_;
994 options.session_handle = session_handle_;
995 TF_RETURN_IF_ERROR(GraphExecutionState::MakeForBaseGraph(
996 std::move(graph), options, &execution_state_));
997 graph_created_ = true;
998 } else {
999 TF_RETURN_IF_ERROR(flib_def_->AddLibrary(graph.library()));
1000 std::unique_ptr<GraphExecutionState> state;
1001 // TODO(mrry): Rewrite GraphExecutionState::Extend() to take `graph` by
1002 // value and move `graph` in here.
1003 TF_RETURN_IF_ERROR(execution_state_->Extend(graph, &state));
1004 execution_state_.swap(state);
1005 }
1006 return Status::OK();
1007}
1008
1009Status DirectSession::Run(const NamedTensorList& inputs,
1010 const std::vector<string>& output_names,

Callers

nothing calls this directly

Calls 5

AddLibraryMethod · 0.80
resetMethod · 0.45
libraryMethod · 0.45
ExtendMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected