Skip to content

LearningModel metadata case insensitive bug fix#3671

Merged
orilevari merged 1 commit intomasterfrom
user/orilevari/case_insensitive_model_metadata
Apr 24, 2020
Merged

LearningModel metadata case insensitive bug fix#3671
orilevari merged 1 commit intomasterfrom
user/orilevari/case_insensitive_model_metadata

Conversation

@orilevari
Copy link
Contributor

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.

…odel metadata. add test to verify case insensitive functionality.
@orilevari orilevari requested a review from a team as a code owner April 23, 2020 22:14
return S_OK;
}

struct CaseInsensitiveHash {
Copy link
Contributor

@martinb35 martinb35 Apr 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/).

Copy link
Contributor

@tiagoshibata tiagoshibata Apr 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You do... else strings that should compare the same will have different hashes

Copy link
Contributor

@tiagoshibata tiagoshibata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants