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
Handle invalid reduction values #6675
Conversation
Hi @adityagandhamal! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Think a bit more. Can we make this bit more efficient? Are we doing unnecessary computation? |
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.
Thanks for the PR @adityagandhamal. Glad you managed to solve the installation issues you phased. The overall approach looks good, I only have a couple of comments. See below:
7c51086
to
e178f36
Compare
@datumbox |
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.
LGTM, thanks a lot for the contribution @adityagandhamal.
@oke-aditya thanks for the support!
I think the issue with the linter is unrelated. I will check again tomorrow to see if it's fixed. cc @pmeier
Actual issue on linter masked by failing linter job
@pmeier Thanks a lot for having a look. I confirm the job runs now correctly. @adityagandhamal Unfortunately there are indeed some linter issues. You can see them here, by clicking on the |
While I agree with @datumbox and thanks a lot to @adityagandhamal for all the work!
IMO the silver bullet was using Enums. Which automatically prevents invalid reduction modes and would have returned error sooner as well as kept the code clean. I think Enum was not used in core due to JIT. That's fine let's accept the current solution as it too works. Anyways let's keep things simple and move ahead 😃 |
Okay |
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.
LGTM (again)! Let's wait for green CI and merge. 😃
Why do some of these tests fail given everything runs fine on my end? |
If They are not be caused by your PR you don't need to worry. There may be some other changes / many reasons for Failures. |
All good. The CI failure is unrelated. Thanks for your work! |
Thank you! |
Summary: * Add ValueError * Add tests for ValueError * Add tests for ValueError * Add ValueError * Change to if/else * Ammend iou_fn tests * Move code excerpt * Format tests Reviewed By: datumbox Differential Revision: D40138724 fbshipit-source-id: 56c742a8c2ff80f2f51cba4cb3156835ed250653 Co-authored-by: Philip Meier <github.pmeier@posteo.de> Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
Fixes #6604
As stated, reduction methods are restricted to ["none", "mean", "sum"].
This PR contains modifications to the code which prompts the user a ValueError if an anonymous value is passed.
Also, added respective unit tests to support the changes.