mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-12 17:57:38 +00:00
Fix a bug in FunctionImpl::FunctionImpl (#3376)
1. Fix a bug in FunctionImpl::FunctionImpl. It set wrong name for the new attribute. 2. Set error code to NOT_IMPLEMENTED if a function contains a not implemented op.
This commit is contained in:
parent
a4fe60c4d3
commit
55fd283d20
2 changed files with 5 additions and 3 deletions
|
|
@ -51,7 +51,7 @@ Status KernelRegistryManager::CreateKernel(const onnxruntime::Node& node,
|
|||
}
|
||||
}
|
||||
|
||||
return Status(ONNXRUNTIME, FAIL, create_error_message("Failed to find kernel for "));
|
||||
return Status(ONNXRUNTIME, NOT_IMPLEMENTED, create_error_message("Failed to find kernel for "));
|
||||
}
|
||||
|
||||
Status KernelRegistryManager::RegisterKernels(const ExecutionProviders& execution_providers) {
|
||||
|
|
@ -119,7 +119,7 @@ Status KernelRegistryManager::SearchKernelRegistry(const onnxruntime::Node& node
|
|||
errormsg << "Failed to find kernel for " << node.OpType();
|
||||
if (node.Op() != nullptr) errormsg << "(" << node.Op()->since_version() << ")";
|
||||
if (!node.Name().empty()) errormsg << " (node " << node.Name() << ")";
|
||||
return Status(ONNXRUNTIME, FAIL, errormsg.str());
|
||||
return Status(ONNXRUNTIME, NOT_IMPLEMENTED, errormsg.str());
|
||||
}
|
||||
|
||||
} // namespace onnxruntime
|
||||
|
|
|
|||
|
|
@ -366,7 +366,9 @@ FunctionImpl::FunctionImpl(const onnxruntime::Graph& graph,
|
|||
if (!(*node_attr).ref_attr_name().empty()) {
|
||||
auto entry = attr_map.find((*node_attr).ref_attr_name());
|
||||
if (entry != attr_map.cend()) {
|
||||
new_attr_map[(*node_attr).name()] = entry->second;
|
||||
onnx::AttributeProto attr_copy = entry->second;
|
||||
attr_copy.set_name(node_attr->name());
|
||||
new_attr_map[(*node_attr).name()] = attr_copy;
|
||||
}
|
||||
} else {
|
||||
new_attr_map[(*node_attr).name()] = *node_attr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue