changeset 199:1400fa04dfab

bugfix
author Frederic Bastien <bastienf@iro.umontreal.ca>
date Tue, 13 May 2008 16:42:51 -0400
parents 136f78559138
children ac61f1178f88
files dataset.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/dataset.py	Tue May 13 16:02:32 2008 -0400
+++ b/dataset.py	Tue May 13 16:42:51 2008 -0400
@@ -1179,9 +1179,11 @@
           def next(self):
               function_inputs = self.input_iterator.next()
               if self.output_dataset.minibatch_mode:
-                  function_outputs = self.output_dataset.function(*function_inputs)
+                  outputs = self.output_dataset.function(*function_inputs)
+                  assert all([hasattr(output,'__iter__') for output in outputs])
+                  function_outputs = [output[0] for output in outputs]
               else:
-                  function_outputs = self.output_dataset.function(function_inputs)
+                  function_outputs = self.output_dataset.function(*function_inputs)
               return Example(self.output_dataset.output_names,function_outputs)
       return ApplyFunctionSingleExampleIterator(self)