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

Method CleanupModelSession

serving/processor/serving/model_session.cc:711–725  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

709}
710
711Status ModelSessionMgr::CleanupModelSession() {
712 mutex_lock lock(mu_);
713 sessions_.erase(
714 std::remove_if(sessions_.begin(), sessions_.end(),
715 [this](ModelSession* sess){
716 if (sess->counter_ <= 0) {
717 delete sess;
718 return true;
719 } else {
720 return false;
721 }
722 }), sessions_.end());
723
724 return Status::OK();
725}
726
727void ModelSessionMgr::ResetServingSession(ModelSession* model_session) {
728 auto tmp = serving_model_session_;

Callers 1

TEST_FFunction · 0.80

Calls 3

eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

TEST_FFunction · 0.64