forked from mindspore-Ecosystem/mindspore
!2231 fix report error in get_dataset_size
Merge pull request !2231 from yanghaitao/yht_get_num_samples
This commit is contained in:
commit
d7d094e1c5
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue