mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-22 22:01:08 +00:00
[CoreML EP] Minor changes to allow CoreML EP to handle more nodes and models. (#15993)
### Description <!-- Describe your changes. --> Minor changes to allow CoreML EP to handle more nodes and models. - Remove graph input dynamic shape check from coreml::GetSupportedNodes(). Each node input is still checked. - Add check for optional input in coreml::IsInputSupported(). If an input does not exist it should not be considered unsupported. ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. --> Some CoreML EP checks seem too strict now.
This commit is contained in:
parent
5a8b892bdc
commit
648bedf91a
1 changed files with 5 additions and 6 deletions
|
|
@ -46,6 +46,11 @@ bool IsNodeSupported(const Node& node, const GraphViewer& graph_viewer, const lo
|
|||
}
|
||||
|
||||
bool IsInputSupported(const NodeArg& input, const std::string& parent_name, const logging::Logger& logger) {
|
||||
if (!input.Exists()) {
|
||||
// optional input that is not provided
|
||||
return true;
|
||||
}
|
||||
|
||||
const auto& input_name = input.Name();
|
||||
const auto* shape_proto = input.Shape();
|
||||
// We do not support input with no shape
|
||||
|
|
@ -86,12 +91,6 @@ std::unordered_set<const Node*> GetSupportedNodes(const GraphViewer& graph_viewe
|
|||
}
|
||||
#endif
|
||||
|
||||
const auto& graph_inputs = graph_viewer.GetInputs();
|
||||
if (std::any_of(graph_inputs.begin(), graph_inputs.end(),
|
||||
[&](const NodeArg* input) { return !IsInputSupported(*input, "graph", logger); })) {
|
||||
return supported_nodes;
|
||||
}
|
||||
|
||||
for (const auto& node : graph_viewer.Nodes()) {
|
||||
const bool supported = IsNodeSupported(node, graph_viewer, logger);
|
||||
LOGS(logger, VERBOSE) << "Operator type: [" << node.OpType()
|
||||
|
|
|
|||
Loading…
Reference in a new issue