!422 dataset: repeair GeneratorDataset to_device problem

Merge pull request !422 from ms_yan/Generator_distri
This commit is contained in:
mindspore-ci-bot 2020-04-17 17:10:20 +08:00 committed by Gitee
commit f8a66ca4fc
1 changed files with 2 additions and 2 deletions

View File

@ -599,9 +599,9 @@ class Dataset:
def get_distribution(output_dataset):
dev_id = 0
if isinstance(output_dataset, (StorageDataset, GeneratorDataset, MindDataset)):
if isinstance(output_dataset, (StorageDataset, MindDataset)):
return output_dataset.distribution, dev_id
if isinstance(output_dataset, (Cifar10Dataset, Cifar100Dataset, ImageFolderDatasetV2,
if isinstance(output_dataset, (Cifar10Dataset, Cifar100Dataset, GeneratorDataset, ImageFolderDatasetV2,
ManifestDataset, MnistDataset, VOCDataset, CelebADataset)):
sampler = output_dataset.sampler
if isinstance(sampler, samplers.DistributedSampler):