| 2241 | } |
| 2242 | |
| 2243 | void TF_DeleteSession(TF_Session* s, TF_Status* status) { |
| 2244 | status->status = Status::OK(); |
| 2245 | if (s == nullptr) return; |
| 2246 | TF_Graph* const graph = s->graph; |
| 2247 | if (graph != nullptr) { |
| 2248 | graph->mu.lock(); |
| 2249 | graph->sessions.erase(s); |
| 2250 | const bool del = graph->delete_requested && graph->sessions.empty(); |
| 2251 | graph->mu.unlock(); |
| 2252 | if (del) delete graph; |
| 2253 | } |
| 2254 | delete s->session; |
| 2255 | delete s; |
| 2256 | } |
| 2257 | |
| 2258 | void TF_SessionRun(TF_Session* session, const TF_Buffer* run_options, |
| 2259 | const TF_Output* inputs, TF_Tensor* const* input_values, |