Skip to content
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

BREAKING: Disable automatic sympy simplification #658

Merged
merged 7 commits into from
Jun 22, 2024

Conversation

MilesCranmer
Copy link
Owner

@MilesCranmer MilesCranmer commented Jun 21, 2024

Fixes #656 by @tbuckworth

This is also the "right thing to do" for other reasons. sympify shouldn't simplify automatically, the user should do it explicitly, otherwise they might be surprised by it being different. Avoiding automatic simplification also reduces the need for extra sympy mappings. This often comes from sympy automatically interpreting things as symbolic, like exp(1.0) == e. This will now be treated as actually exp of 1.0.

Also adds sympy.NumberSymbol support in both sympy2jax and sympy2torch with new tests.

@MilesCranmer MilesCranmer changed the title Disable sympy simplification BREAKING: Disable automatic sympy simplification Jun 22, 2024
@MilesCranmer MilesCranmer merged commit 7fc7b82 into master Jun 22, 2024
33 checks passed
@MilesCranmer MilesCranmer deleted the fix-number-symbol branch June 22, 2024 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: torch export fails for expressions with constant inputs e.g. exp(2)
1 participant