Fix a bug in KernelRegistry::Register function

This commit is contained in:
Changming Sun 2019-01-23 15:31:21 -08:00
parent bca8daf762
commit 82b4ec3d42

View file

@ -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;
}
}