-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Generate tests for MeanSquareDistance and SoftmaxCrossEntropyLoss #2623
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
Maybe a check could be added to CI, similar to how (I believe) it checks docs are up to date |
exactly, I like the idea on adding a check on the doc update, same as proto and operator docs. @TMVector are you interested in it? :) |
This should partly fix a bug where names are mapped differently for node inputs and outputs.
Unfortunately generating these tests seems to expose issues with the definition of MeanSquareDistance and SoftmaxCrossEntropyLoss, plus with function expansion. I'm looking at fixes now. |
This hopefully fixes a bug related to intermediate values inside function bodies being erroneously dropped if they were also outputs.
@@ -22,22 +22,28 @@ | |||
from onnx.onnx_operators_pb import FunctionProto | |||
|
|||
|
|||
# FIXME(TMVector): Any reason we can't get rid of this and use the C++ helper directly? |
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.
TODO/question -- can we remove the Python function expansion helper and use the one from C++?
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.
The changes look good to me, thanks! I guess we can import the C++ version into Python (provided there is no subtle difference between them due to bugs, etc., I suppose). I guess that could be a different PR, given that we are close to the cutoff date for the next ONNX release.
50474e8
to
6443e3d
Compare
6443e3d
to
1808901
Compare
…nx#2623) * Generate tests for MeanSquareDistance and SoftmaxCrossEntropyLoss * Fix logic error in MSD/SCE function builders * Regenerate MeanSquareDistance and SoftmaxCrossEntropyLoss backend tests * Add keepdims=0 to Reduce operators in function body of MSD * Add shape inference test for reducing all dims with keepdims=0 * Unify input/output name mapping in function expansion This should partly fix a bug where names are mapped differently for node inputs and outputs. * Use fresh name for missing outputs of functions This hopefully fixes a bug related to intermediate values inside function bodies being erroneously dropped if they were also outputs. * Regenerate MeanSquareDistance and SoftmaxCrossEntropy backend tests * Fix SCE to use 'reduction' attribute from function for NLL * Regenerate backend tests for SoftmaxCrossEntropyLoss Co-authored-by: Prasanth Pulavarthi <prasantp@microsoft.com>
I noticed some backend tests on master hadn't been generated. Looks like the function-expanded ones for #2570 and #2573, so should probably go in for 1.7.