-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Added multiple related fixes to enable automatic addition of KeyToValue #4878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ue in the Nimbus codepath
OnnxNode node; | ||
var binarizerOutput = ctx.AddIntermediateVariable(null, "BinarizerOutput", true); | ||
string opType = "Binarizer"; | ||
var binarizerOutput = ctx.AddIntermediateVariable(NumberDataViewType.Single, "BinarizerOutput", false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
false [](start = 108, length = 5)
What does this false mean?
#Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
False = Do not skip adding shape and type information (or in other words, add shape and type information). False is the default value. Technically it is not necessary to specify it.
In reply to: 383088227 [](ancestors = 383088227)
{ | ||
Host.Assert(Bindings.InfoCount >= 3); | ||
scoreColumn = outColumnNames[2]; | ||
var one = ctx.AddInitializer(1.0f, "one"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ctx.AddInitializer(1.0f, "one"); [](start = 26, length = 32)
Is this +1 ? to be 1 based? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is to make it one based and make it consistent with ML.NET results.
In reply to: 383088629 [](ancestors = 383088629)
@@ -804,7 +804,7 @@ private bool SaveAsOnnxCore(OnnxContext ctx, int iinfo, ColInfo info, string src | |||
else if (info.TypeSrc.GetItemType().Equals(NumberDataViewType.Double)) | |||
{ | |||
// LabelEncoder doesn't support double tensors, so values are cast to floats | |||
var castOutput = ctx.AddIntermediateVariable(null, "castOutput", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
null [](start = 65, length = 4)
How did it work with null before? Was there an exception? #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the last parameter is true, it skips adding shape and type information and therefore accepts null. This still works, but I am prepping some parts of the code base for issues I have seen when run against the master branch of ORT.
There will be an exception if you specify null and set the last parameter to false.
In reply to: 383088824 [](ancestors = 383088824)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR includes a number of fixes to enable automatic addition of KeyToValue in the Nimbus codepath. Specifically: