From 5868daffda0e0be6111adb3521dfea851703dc6e Mon Sep 17 00:00:00 2001 From: lizhenyu Date: Sat, 30 May 2020 15:39:40 +0800 Subject: [PATCH] clean codedex warning --- mindspore/ccsrc/device/kernel_runtime_manager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mindspore/ccsrc/device/kernel_runtime_manager.cc b/mindspore/ccsrc/device/kernel_runtime_manager.cc index 4fc6a62297..ca6f386b50 100644 --- a/mindspore/ccsrc/device/kernel_runtime_manager.cc +++ b/mindspore/ccsrc/device/kernel_runtime_manager.cc @@ -54,7 +54,7 @@ KernelRuntime *KernelRuntimeManager::GetSingleKernelRuntime(const std::string &d return runtime_iter->second.get(); } else if (runtime_map_.size() > 0) { auto cur_runtime_key = runtime_map_.begin()->first; - if (!cur_runtime_key.empty()) { + if (cur_runtime_key.rfind('_') != std::string::npos) { auto cur_device_id = cur_runtime_key.substr(cur_runtime_key.rfind('_') + 1); MS_LOG(EXCEPTION) << "Can't change device id in runtime, already set device id: " << cur_device_id << ", set device id: " << device_id << " failed";