changeset 1457:9d941cd77479

fixed bug in tile_slice
author James Bergstra <bergstrj@iro.umontreal.ca>
date Mon, 04 Apr 2011 23:22:18 -0400
parents 272879b84d30
children 31d8c6a0a70d
files pylearn/io/image_tiling.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/io/image_tiling.py	Mon Apr 04 19:03:48 2011 -0400
+++ b/pylearn/io/image_tiling.py	Mon Apr 04 23:22:18 2011 -0400
@@ -187,9 +187,10 @@
                 dtype='uint8')
 
     if scale_each:
-        x = X.copy()
+        uintX = numpy.empty(X.shape, dtype='uint8')
         for i, Xi in enumerate(X):
-            X[i] = scale_0_255(Xi)
+            uintX[i] = scale_0_255(Xi)
+        X = uintX
     else:
         X = scale_0_255(X)
     return tile_slices_to_image_uint8(X, tile_shape=tile_shape)