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

Method Extend

tensorflow/core/distributed_runtime/master_session.cc:1685–1712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1683}
1684
1685Status MasterSession::Extend(const ExtendSessionRequest* req,
1686 ExtendSessionResponse* resp) {
1687 UpdateLastAccessTime();
1688 std::unique_ptr<GraphExecutionState> extended_execution_state;
1689 {
1690 mutex_lock l(mu_);
1691 if (closed_) {
1692 return errors::FailedPrecondition("Session is closed.");
1693 }
1694
1695 if (graph_version_ != req->current_graph_version()) {
1696 return errors::Aborted("Current version is ", graph_version_,
1697 " but caller expected ",
1698 req->current_graph_version(), ".");
1699 }
1700
1701 CHECK(execution_state_);
1702 TF_RETURN_IF_ERROR(
1703 execution_state_->Extend(req->graph_def(), &extended_execution_state));
1704
1705 CHECK(extended_execution_state);
1706 // The old execution state will be released outside the lock.
1707 execution_state_.swap(extended_execution_state);
1708 ++graph_version_;
1709 resp->set_new_graph_version(graph_version_);
1710 }
1711 return Status::OK();
1712}
1713
1714WorkerCacheInterface* MasterSession::get_worker_cache() const {
1715 if (worker_cache_) {

Callers 1

ExtendSessionMethod · 0.45

Calls 3

FailedPreconditionFunction · 0.85
graph_defMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected