-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Converting data types takes longer time #15621
Comments
I don't see this on my machine:
I suspect this is another case of #15545. |
Possibly useful info:
|
@Hellcat1005 just to be sure and narrow it down, gh-15545 suggests that this is a kernel speed issue that was fixed (probably in 4.6), could you tell what |
@Hellcat1005 upgrading to kernel 4.15 fixed similar performance issues for me. Assuming you're using Ubuntu 16.04, try installing linux-image-generic-hwe-16.04. |
Reproducing code example:
import numpy as np
import time
a = np.zeros((400, 400, 400), dtype=np.int32)
a[a == 0] = 255
t1 = time.time()
b = a.astype(np.float32)
print(time.time() - t1)
For numpy 1.17.3, it take 5 seconds. For numpy 1.16.4, only 0.1 seconds.
The text was updated successfully, but these errors were encountered: