# HG changeset patch # User Frederic Bastien # Date 1296675181 18000 # Node ID e1b5092b4a5371630cc786e5e30b34ef7d8fc2f7 # Parent 68fdb895f53f5d1c111dcf948c5fa1b9ffa8674f allow to read gzip filetensor when there is more then 1 tensor in the file. diff -r 68fdb895f53f -r e1b5092b4a53 pylearn/io/filetensor.py --- a/pylearn/io/filetensor.py Wed Feb 02 12:39:35 2011 -0500 +++ b/pylearn/io/filetensor.py Wed Feb 02 14:33:01 2011 -0500 @@ -202,9 +202,8 @@ rval = None if isinstance(f, gzip.GzipFile): assert subtensor is None, "Not implemented the subtensor case for gzip file" - d = f.read() - rval = numpy.fromstring(d, dtype=magic_t, - count=_prod(dim)).reshape(dim) + d = f.read(_prod(dim)*elsize) + rval = numpy.fromstring(d, dtype=magic_t).reshape(dim) del d elif subtensor is None: rval = numpy.fromfile(f, dtype=magic_t, count=_prod(dim)).reshape(dim)