-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
MOI Constraint jacobian-vector fixes #845
Conversation
FYI @baggepinnen |
Can you add a test which catches this? |
@aml5600 can you add the test, happy to merge it right away once that's added |
e9cfdeb
to
56f4601
Compare
@Vaibhavdixit02 sorry for the delay, please let me know if the tests are sufficient. They failed before, passed after the changes. |
lib/OptimizationMOI/test/runtests.jl
Outdated
y = zeros(2) | ||
w = ones(1) | ||
@test MathOptInterface.eval_constraint_jacobian_transpose_product( | ||
evaluator, y, x, w) isa Any |
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.
Is it really Any
here? I guess since it's inplace it returns nothing
?
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.
I guess it should return nothing
? I just have used isa Any
on tests that modify inputs to verify that they don't fail. I figured checking the correctness of the return values in y
was a bit out of scope for this PR.
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.
made it explicitly return nothing.
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
It seems that the methods
MOI.eval_constraint_jacobian_transpose_product
andMOI.eval_constraint_jacobian_product
were incorrectly both evaluating the products and erroring when the evaluator possessedcons_vjp
orcons_jvp
functions.Add any other context about the problem here.