-
-
Notifications
You must be signed in to change notification settings - Fork 591
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
Don't convert float32 to float64 in affine_transform #4452
Conversation
I believe the casting from integer to float is a vestige from when we were normalizing the data array before passing it to In other words, I'd strip out the casting code entirely, add |
A bit tangential to this PR, but... #2041 removed the normalization code and cast everything to float64. However, I believe the removal of the normalization code should not have been done. Scikit-image's documentation is quite clear that it always assumes that floats are in the range of [0, 1]. While I suggest that the normalization code be re-inserted. |
45523d5
to
8f9572b
Compare
8f9572b
to
45523d5
Compare
I had a play around with suggestions, and decided they were more complicated than they seem to implement. In the interests of fixing the original bug, and maintaining other behaviour so this can be backported to 2.0.x, I have kept this simple and opened #4453. |
Failures are server related. |
Large (e.g. AIA) maps can take up lots of memory (100MB+). As long as accuracy can be sacrificed, these can be converted from 64 to 32 bit floats to save memory. However,
affine_transform
casts anything that isn't float64 up to float64. Looking at the git history this seems to be to avoid passing integer dytpes towarp
, but I don't think this needs to be done for float32.This PR changes the casting check to make it so that only integer dtypes are cast to float64, avoiding float32 being cast up and reducing memory usage.