don't use np.empty_like with dtype argument to be numpy 1.5 compatible.

This commit is contained in:
andy
2011-09-27 23:51:14 +02:00
parent 7404896730
commit 375079e82f
+1 -3
View File
@@ -75,9 +75,7 @@ def _convert(image, dtype, prec_loss):
# Do scaling/shifting calculations in floating point
image = image.astype(np.float64)
out = np.empty_like(image, dtype=dtype)
out[:] = round_fn((image - imin) * scale + shift)
out = round_fn((image - imin) * scale + shift).astype(dtype)
return out