Added multiple related fixes to enable automatic addition of KeyToValue#4878
Added multiple related fixes to enable automatic addition of KeyToValue#4878harishsk merged 2 commits intodotnet:masterfrom harishsk:onnxMultipleFixes
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.
false [](start = 108, length = 5)
What does this false mean?
#Resolved
There was a problem hiding this comment.
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.
ctx.AddInitializer(1.0f, "one"); [](start = 26, length = 32)
Is this +1 ? to be 1 based? #Resolved
There was a problem hiding this comment.
Yes, this is to make it one based and make it consistent with ML.NET results.
In reply to: 383088629 [](ancestors = 383088629)
| 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.
null [](start = 65, length = 4)
How did it work with null before? Was there an exception? #Resolved
There was a problem hiding this comment.
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)
This PR includes a number of fixes to enable automatic addition of KeyToValue in the Nimbus codepath. Specifically: