changeset 332:dada08a6adb8

redone my previous hack in MinibatchToSingleExampleIterator, tests should work again
author Thierry Bertin-Mahieux <bertinmt@iro.umontreal.ca>
date Mon, 16 Jun 2008 16:44:11 -0400
parents 52aa031e1fe3
children 7d2f7b8fe213 a0f150a33b0f
files dataset.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dataset.py	Mon Jun 16 16:38:03 2008 -0400
+++ b/dataset.py	Mon Jun 16 16:44:11 2008 -0400
@@ -242,9 +242,9 @@
             if not self.minibatch:
                 names = size1_minibatch.keys()
                 # next lines are a hack, but there was problem when we were getting [array(327)] for instance
-                if len(size1_minibatch.values()[0].shape) > 0 :
+                try:
                     values = [value[0] for value in size1_minibatch.values()]
-                else :
+                except :
                     values = [value for value in size1_minibatch.values()]
                 self.minibatch = Example(names,values)
             else: