提交 9b547e20 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!2751 fix mix target device id

Merge pull request !2751 from kisnwang/fix-mix-target-device-id-r0.5
......@@ -353,7 +353,10 @@ void MsBackend::CreateOtherSession(const std::string &target) {
if (other_sess_ == nullptr) {
MS_LOG(EXCEPTION) << "Session create failed!, please make sure target device:" << target << " is available.";
}
other_sess_->Init(0);
auto context_ptr = MsContext::GetInstance();
MS_EXCEPTION_IF_NULL(context_ptr);
uint32_t device_id = context_ptr->device_id();
other_sess_->Init(device_id);
other_sess_->RegisterSummaryCallBackFunc(callbacks::SummarySaveCallback);
other_device_ = target;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册