| 921 | } |
| 922 | |
| 923 | DirectSession::~DirectSession() { |
| 924 | if (!closed_) Close().IgnoreError(); |
| 925 | for (auto& it : partial_runs_) { |
| 926 | it.second.reset(nullptr); |
| 927 | } |
| 928 | for (auto& it : executors_) { |
| 929 | it.second.reset(); |
| 930 | } |
| 931 | callables_.clear(); |
| 932 | for (auto d : device_mgr_->ListDevices()) { |
| 933 | d->op_segment()->RemoveHold(session_handle_); |
| 934 | } |
| 935 | functions_.clear(); |
| 936 | delete cancellation_manager_; |
| 937 | for (const auto& p_and_owned : thread_pools_) { |
| 938 | if (p_and_owned.second) delete p_and_owned.first; |
| 939 | } |
| 940 | |
| 941 | for (const auto& p_inter_and_intra : stage_subgraph_thread_pools_) { |
| 942 | delete p_inter_and_intra.first; |
| 943 | delete p_inter_and_intra.second; |
| 944 | } |
| 945 | |
| 946 | execution_state_.reset(nullptr); |
| 947 | flib_def_.reset(nullptr); |
| 948 | |
| 949 | delete device_mgr_; |
| 950 | |
| 951 | if (multi_stream_shared_rmgr_) { |
| 952 | delete multi_stream_shared_rmgr_; |
| 953 | } |
| 954 | } |
| 955 | |
| 956 | Status DirectSession::Create(const GraphDef& graph) { |
| 957 | return Create(GraphDef(graph)); |
nothing calls this directly
no test coverage detected