!2231 fix report error in get_dataset_size

Merge pull request !2231 from yanghaitao/yht_get_num_samples
This commit is contained in:
mindspore-ci-bot 2020-06-20 19:58:16 +08:00 committed by Gitee
commit d7d094e1c5
1 changed files with 2 additions and 0 deletions

View File

@ -115,6 +115,8 @@ class Sampler:
return self.child_sampler.is_sharded()
def get_num_samples(self):
if self.num_samples is None:
return None
return self._get_indices().size