-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle input initializers correctly in constant folding (#1944)
Values that are both inputs and initializers of a model/graph should not be treated as constants (and cannot be used for constant-folding). Unfortunately, the single `const_value` field is class Value is used both to indicate constant-values of proper constants as well as initializer values of initializers. Ideally, the IR should provide an easy way to distinguish this at the value level (with either an extra boolean flag to indicate the value is an input-value or by using distinct fields for "initializer_value" and "const_value". Meanwhile, this PR introduces a workaround to handle the main issue.
- Loading branch information
1 parent
1cfe0ca
commit 5a35958
Showing
2 changed files
with
50 additions
and
0 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