From aead81941faf35f58325335859179d42d7d8f689 Mon Sep 17 00:00:00 2001 From: liubuyu Date: Tue, 11 Aug 2020 17:21:09 +0800 Subject: [PATCH] fix device occupied bug --- mindspore/ccsrc/utils/context/context_extends.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mindspore/ccsrc/utils/context/context_extends.cc b/mindspore/ccsrc/utils/context/context_extends.cc index 2588cfddd74..0ba3289b647 100644 --- a/mindspore/ccsrc/utils/context/context_extends.cc +++ b/mindspore/ccsrc/utils/context/context_extends.cc @@ -329,7 +329,7 @@ bool FinalizeGe(const std::shared_ptr &ms_context_ptr, bool force) { if (ge::GEFinalize() != ge::GRAPH_SUCCESS) { MS_LOG(WARNING) << "Finalize GE failed!"; } - ms_context_ptr->set_pynative_ge_init(true); + ms_context_ptr->set_pynative_ge_init(fasle); } else { MS_LOG(INFO) << "Ge is used, no need to finalize, tsd reference = " << ms_context_ptr->ge_ref() << "."; } @@ -341,14 +341,14 @@ bool IsTsdOpened(const std::shared_ptr &ms_context_ptr) { if (ms_context_ptr == nullptr) { MS_LOG(EXCEPTION) << "nullptr"; } - return ms_context_ptr->tsd_ref(); + return ms_context_ptr->IsTsdOpened(); } bool IsGeInited(const std::shared_ptr &ms_context_ptr) { if (ms_context_ptr == nullptr) { MS_LOG(EXCEPTION) << "nullptr"; } - return ms_context_ptr->ge_ref(); + return ms_context_ptr->IsGeInited(); } // Register for device type.