initialize generated_value_names with graph input#8085
Merged
Conversation
| # some output from nodes will be quantized, yet itself should be treat as existing so | ||
| # no dequantized will be applied when needed later | ||
| self.generated_value_names = {} | ||
| self.generated_value_names = self.model.get_non_initializer_inputs() |
Contributor
There was a problem hiding this comment.
Nice concept, could we also add both initializer and input here?
Member
Author
There was a problem hiding this comment.
We have a logic to remove quantized initializer below. If the initializer is used by both quantized op and fp32 op, there will be no logic to dequantize the quantized initializer back.
|
|
||
| def get_non_initializer_inputs(self): | ||
| initializer_names = self.get_initializer_name_set() | ||
| non_initializer_inputs = set() |
Contributor
There was a problem hiding this comment.
If set is used, later usage for generated_value_names better also change to set() semantic
Member
Author
There was a problem hiding this comment.
get_non_initializer_inputs returns set type and the generated_value_names is assigned with the set
Contributor
There was a problem hiding this comment.
I mean later code is using it as map
zhanghuanrong
approved these changes
Jun 22, 2021
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
generated_value_names should be initialized with graph input, or it will add a dequantize for input, which is used by another op.