accept dist sampler classes

This commit is contained in:
William Falcon
2019-07-16 12:44:58 -04:00
parent b4bdb283ce
commit 28cfddbe65
+1 -1
View File
@@ -277,7 +277,7 @@ class Trainer(TrainerIO):
self.test_dataloader = model.test_dataloader
self.val_dataloader = model.val_dataloader
if self.data_parallel and type(self.tng_dataloader.sampler) is not DistributedSampler:
if self.data_parallel and issubclass(self.tng_dataloader.sampler, DistributedSampler):
msg = '''
when using multiple gpus and multiple nodes you must pass a DistributedSampler to DataLoader(sampler).