!1590 dataset: fix some format problem in take and split

Merge pull request !1590 from ms_yan/r0.3_format
This commit is contained in:
mindspore-ci-bot 2020-05-28 19:31:33 +08:00 committed by Gitee
commit 00a4e188b7
1 changed files with 12 additions and 11 deletions

View File

@ -590,7 +590,7 @@ class Dataset:
# here again
dataset_size = self.get_dataset_size()
if(dataset_size is None or dataset_size <= 0):
if dataset_size is None or dataset_size <= 0:
raise RuntimeError("dataset size unknown, unable to split.")
all_int = all(isinstance(item, int) for item in sizes)
@ -1173,6 +1173,7 @@ class SourceDataset(Dataset):
def is_sharded(self):
raise NotImplementedError("SourceDataset must implement is_sharded.")
class MappableDataset(SourceDataset):
"""
Abstract class to represent a source dataset which supports use of samplers.