forked from microsoft/onnxruntime
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CPU constant folding not reverting the node to its previous EP (m…
…icrosoft#17399) A recent change was made in microsoft@5a83a67 to make `ep_type` a reference instead of having it be a copy, presumably to avoid assigning strings (so `auto& ep_type = node->GetExecutionProviderType()` instead of `auto ep_type = node->GetExecutionProviderType()`). The problem with this change is that calling `node->SetExecutionProviderType(kCpuExecutionProvider)` will change the value of the reference itself, which means that it's impossible to revert the node to its previous EP. This change fixes this bug and adds an optimization over the previous approach by only assigning a string when we know that we are dealing with a non-CPU node.
- Loading branch information
1 parent
bf6d696
commit 8ad9ab1
Showing
3 changed files
with
59 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
onnxruntime/test/testdata/transform/constant_float16_mul.onnx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters