-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
jax printer doesn't properly convert sympy Min and Max during lambdify #26139
Comments
So should this work?? |
Hey I have made one more change, and I wished to test it. Please can someone help me with that. |
yes although i might suggest something like this to remove the redundant parentheses thanks for looking into this!
|
@dardeshna I'm pretty new to open source, what do I do next? Should I issue a Pull request? |
Honestly me as well — probably open a PR and look through the contributing guidelines for the project to see the workflow used by sympy? |
okay i looked into it, I am currently running all the tests, and then probably open a PR, btw I really need to thank you, sir, this is literally my first issue solved in open source |
ouch it fails 15 errors |
one of the tests is being detected as trojan on my windows computer, please can someone help |
Okay, so it's now three errors only, and one is such that Windows Defender detects it as a trojan, should I allow this file to run by putting it on Defender's whitelist? |
It is hard to answer about the trojan without more information. It sounds like an overzealous virus checker but hard to be sure. |
Also, please can tell someone tell what is _np here??
This code is from sympy\solvers\tests\test_simplex |
So how do I proceed with this, I shouldn't commit if there's an error right? There is an option to allow this code to run by putting it on whitelist but the question is can this code be trusted For reference this test is sympy\utilities_compilation\tests\test_compilation.py |
It looks like that |
While it's usually best to try to get everything working before committing, if you can't figure something out, it's better to just commit what you have an make a pull request with it, so that others can help you figure out how to fix it. It's much easier for people to help you if your code is pushed up so that they can see it and checkout and try it themselves. |
jax can't accept tuples as input to amin and amax the same way that numpy does. this results in the following error when lambdifying a sympy expression with min/max:
sympy/sympy/printing/numpy.py
Lines 218 to 222 in a07d5bc
i think the fix is simply to wrap the tuple in a
jax.numpy.asarray()
call (similarly to how and/or are carved out for jax)The text was updated successfully, but these errors were encountered: