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

replace const Arrays with Constants in optimize #854

Merged
merged 2 commits into from
Feb 27, 2024

Conversation

joostvanzwieten
Copy link
Member

To speed-up repeated evaluation of the same Evaluable, this PR introduces Evaluable._deep_flatten_constants, which replaces constant Arrays with Constants, excluding the no-op arrays Transpose and InsertAxis, and includes this in optimized_for_numpy.

To speed-up repeated evaluation of the same `Evaluable`, this patch introduces
`Evaluable._deep_flatten_constants`, which replaces constant `Array`s with
`Constant`s, excluding the no-op arrays `Transpose` and `InsertAxis`, and
includes this in `optimized_for_numpy`.
This patch removes the special-cased optimization for transforming constant
`Pointwise`s to `Constant`s in favour of the just introduced, generic
`_deep_flatten_constants`.
@joostvanzwieten joostvanzwieten merged commit 99349c0 into master Feb 27, 2024
23 checks passed
@joostvanzwieten joostvanzwieten deleted the flatten-constants branch February 27, 2024 11:40
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.

2 participants