mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-29 03:30:52 +00:00
set node schema when apply NHWC transformer (#13660)
### Description set node schema when apply NHWC transformer ### Motivation and Context The implementation in `IExecutionProvider::GetCapability()` checks node schema to determine the capability of the current EP. If NHWC graph transformer created a new channel last `Conv` node to replace the channel first `Conv` node, we need to assign the schema to the replaced node.
This commit is contained in:
parent
ce460f9cdb
commit
2bebe6189a
1 changed files with 12 additions and 1 deletions
|
|
@ -909,7 +909,18 @@ Status TransformLayoutForEP(Graph& graph, bool& modified, const IExecutionProvid
|
|||
onnx_layout_transformation::WrapTransposesAroundNode(*api_graph, *node, {&input_perm}, {&output_perm});
|
||||
}
|
||||
|
||||
onnx_layout_transformation::SwapNodeOpTypeAndDomain(*api_graph, *node, node->OpType(), kMSInternalNHWCDomain);
|
||||
[[maybe_unused]] auto new_node_ref =
|
||||
onnx_layout_transformation::SwapNodeOpTypeAndDomain(*api_graph, *node, node->OpType(), kMSInternalNHWCDomain);
|
||||
|
||||
#if !defined(ORT_MINIMAL_BUILD)
|
||||
// Set the schema if one is available. This keeps the node equivalent with the state of the original ONNX
|
||||
// node (if possible - some replacement nodes do not have a schema).
|
||||
//
|
||||
Node& new_node = NodeFromApiNode(*new_node_ref);
|
||||
// add schema if available.
|
||||
// not guaranteed to be (compiling EP doesn't need schemas, not available in minimal build
|
||||
graph.SetOpSchemaFromRegistryForNode(new_node);
|
||||
#endif
|
||||
modified = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue