forked from mindspore-Ecosystem/mindspore
!422 dataset: repeair GeneratorDataset to_device problem
Merge pull request !422 from ms_yan/Generator_distri
This commit is contained in:
commit
f8a66ca4fc
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue