-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Added onnx export support for several multiclass classifiers #4462
Conversation
@@ -499,6 +505,10 @@ private abstract class ImplBase : ISingleCanSavePfa | |||
public abstract ValueMapper<VBuffer<float>, VBuffer<float>> GetMapper(); | |||
public abstract JToken SaveAsPfa(BoundPfaContext ctx, JToken input); | |||
|
|||
public bool CanSaveOnnx(OnnxContext ctx) => Predictors.All(pred => (pred as ICanSaveOnnx)?.CanSaveOnnx(ctx) == 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.
(pred as ICanSaveOnnx)? [](start = 79, length = 23)
What happens if it cant cast? #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 it can't cast, it will return a null. And the question mark after the ')' ensures makes it a null conditional operator and will not execute further and the overall function will return false.
In reply to: 348211703 [](ancestors = 348211703)
Codecov Report
@@ Coverage Diff @@
## master #4462 +/- ##
=========================================
Coverage ? 75.01%
=========================================
Files ? 908
Lines ? 160800
Branches ? 17371
=========================================
Hits ? 120629
Misses ? 35460
Partials ? 4711
|
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 adds Onnx export support + tests for the following multiclass classifiers:
There is a question marked with a REVIEW comment in the PR below. Please comment if you know of a better way to do what is done there.