提交 d7d094e1 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!2231 fix report error in get_dataset_size

Merge pull request !2231 from yanghaitao/yht_get_num_samples
...@@ -115,6 +115,8 @@ class Sampler: ...@@ -115,6 +115,8 @@ class Sampler:
return self.child_sampler.is_sharded() return self.child_sampler.is_sharded()
def get_num_samples(self): def get_num_samples(self):
if self.num_samples is None:
return None
return self._get_indices().size return self._get_indices().size
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册