-
Notifications
You must be signed in to change notification settings - Fork 48
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
Allow NaN and infinite values for float attributes #800
Comments
See here and here for past discussion. We settled on not adding https://g-issues.chromium.org/issues/382108345 doesn't provide use cases either, it's just pointing out where the impl doesn't match the spec. Are there use cases, e.g. existing models where ORT Web would generate e.g. elu() calls with Infinities or NaNs? If so, happy to revisit! |
Use-case-wise, I know no benefit 🤔 (and for elu in particular, I expect no inf/nan), leaving as a remaining argument broadly applied principled stances, as it is reasonable for self-consistency. Note also the parameter being passed by option-dict value rather than inside a tensor is really the only reason this is even in discussion, because if it was inside the tensor, it would just work as expected per normal IEEE rules.
Looking at the current operators that still use double parameters (rather than a tensor or dictionary MLBatchNormalizationOptions : MLOperatorOptions {
...
double epsilon = 1e-5;
};
dictionary MLEluOptions : MLOperatorOptions {
double alpha = 1;
};
dictionary MLGemmOptions : MLOperatorOptions {
...
double alpha = 1.0;
double beta = 1.0;
...
};
dictionary MLHardSigmoidOptions : MLOperatorOptions {
double alpha = 0.2;
double beta = 0.5;
};
dictionary MLInstanceNormalizationOptions : MLOperatorOptions {
...
double epsilon = 1e-5;
...
};
dictionary MLLayerNormalizationOptions : MLOperatorOptions {
...
double epsilon = 1e-5;
};
dictionary MLLeakyReluOptions : MLOperatorOptions {
double alpha = 0.01;
};
dictionary MLLinearOptions : MLOperatorOptions {
double alpha = 1;
double beta = 0;
}; None of these have a strong use case to support inf/nan AFAICS, and the pro's and con's don't show a clear winner above for making the parameters |
+1 to keep the status quo. |
Implementation (Chromium/Blink) issue created: https://issues.chromium.org/issues/386611711, closing this one. |
This issue was raised in this CL review- https://chromium-review.googlesource.com/c/chromium/src/+/6081404/5..10/third_party/blink/web_tests/external/wpt/webnn/validation_tests/elu.https.any.js#b50.
The current blink IDL uses float alpha while spec defines as double alpha. I suppose both have issues and it should be defined as unrestricted double which supports both infinite and NaN.
The text was updated successfully, but these errors were encountered: