fix dataloader sharing
@@ -223,12 +223,14 @@ class FixedDialogTeacher(Teacher):
if hasattr(self, 'examples'):
shared['examples'] = self.examples
+ if hasattr(self, 'data_loader'):
+ shared['data_loader'] = self.data_loader
+
if self.opt.get('numthreads', 1) > 1:
if type(self.index) is not multiprocessing.sharedctypes.Synchronized:
# for multithreading need to move index into threadsafe memory
self.index = Value('l', -1)
- else:
- shared['data_loader'] = self.data_loader
+
shared['index'] = self.index
return shared
