From 82b4ec3d427d181d97fa1856d3eb83590c9345e5 Mon Sep 17 00:00:00 2001 From: Changming Sun Date: Wed, 23 Jan 2019 15:31:21 -0800 Subject: [PATCH] Fix a bug in KernelRegistry::Register function --- onnxruntime/core/framework/kernel_registry.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/core/framework/kernel_registry.cc b/onnxruntime/core/framework/kernel_registry.cc index 61412de52a..af756f5555 100644 --- a/onnxruntime/core/framework/kernel_registry.cc +++ b/onnxruntime/core/framework/kernel_registry.cc @@ -161,14 +161,14 @@ Status KernelRegistry::Register(KernelCreateInfo&& create_info) { if (i->second.kernel_def && i->second.status.IsOK() && i->second.kernel_def->IsConflict(*create_info.kernel_def)) { - create_info.status = + auto st = create_info.status = Status(ONNXRUNTIME, FAIL, "Failed to add kernel for " + op_name + ": Conflicting with a registered kernel with op versions."); // For invalid entries, we keep them in the map now. Must check for status // when using the entries from the map. kernel_creator_fn_map_.emplace(op_name, std::move(create_info)); - return create_info.status; + return st; } }