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

Reduce memory allocation during some styling operations #1262

Merged
merged 1 commit into from
Aug 14, 2023
Merged

Conversation

manthey
Copy link
Member

@manthey manthey commented Aug 14, 2023

Specifically, when we apply a style, in some instances the tile or region is converted from one dtype to a float in order to preserve some of the transform properties through the process. We had been using float, which internally is np.float64. But, np.float32 gives sufficient accuracy for our styles. With this change, np.float32 is used unless the base datatype is float64, in which we do not reduce the precision.

Specifically, when we apply a style, in some instances the tile or
region is converted from one dtype to a float in order to preserve some
of the transform properties through the process.  We had been using
`float`, which internally is `np.float64`.  But, `np.float32` gives
sufficient accuracy for our styles.  With this change, `np.float32` is
used unless the base datatype is `float64`, in which we do not reduce
the precision.
@manthey manthey merged commit e7191d6 into master Aug 14, 2023
@manthey manthey deleted the style-memory branch August 14, 2023 20:39
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.

1 participant