# HG changeset patch # User Frederic Bastien # Date 1210699385 14400 # Node ID 895b4b60f5e8bbb7b68a67fa3248e367b55b15b7 # Parent bc72a0fa6d0199fb4e70fbf7c9c9a8d775bd25b1 bugfix. Otherwise the example was writed over and not a new one was returned diff -r bc72a0fa6d01 -r 895b4b60f5e8 dataset.py --- a/dataset.py Tue May 13 13:09:59 2008 -0400 +++ b/dataset.py Tue May 13 13:23:05 2008 -0400 @@ -4,7 +4,7 @@ from misc import unique_elements_list_intersection from string import join from sys import maxint -import numpy +import numpy, copy from exceptions import * @@ -1053,7 +1053,7 @@ fields_values = source_dataset.minibatches(minibatch_size=len(source_dataset)).__iter__().next() assert all([len(self)==len(field_values) for field_values in fields_values]) for example in fields_values.examples(): - self.cached_examples.append(example) + self.cached_examples.append(copy.copy(example)) self.fieldNames = source_dataset.fieldNames self.hasFields = source_dataset.hasFields