LearningModel metadata case insensitive bug fix#3671
Merged
Conversation
…odel metadata. add test to verify case insensitive functionality.
martinb35
reviewed
Apr 23, 2020
| return S_OK; | ||
| } | ||
|
|
||
| struct CaseInsensitiveHash { |
Contributor
There was a problem hiding this comment.
do you need to write your own hash? you're just trying to override the equality part, right? can you use the default hash "class Hash = hash" (see http://www.cplusplus.com/reference/unordered_map/unordered_map/ and http://www.cplusplus.com/reference/functional/hash/).
Contributor
There was a problem hiding this comment.
You do... else strings that should compare the same will have different hashes
tiagoshibata
approved these changes
Apr 23, 2020
Contributor
tiagoshibata
left a comment
There was a problem hiding this comment.
Looks good to me. There was some other place in WinML or in the dashboard that did the same thing, and the solution was converting all keys to lowercase when creating the metadata and when doing the lookup. Your solution is a bit longer but looks cleaner.
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.
Description: Return case insensitive map for LearningModel Metadata(). Add test to verify behavior.
Motivation and Context
The onnx spec says that Model metadata is case insensitive, but until now our LearningModel api returned a case sensitive map for metadata.