forked from mindspore-Ecosystem/mindspore
!2059 fix SubsetSampler error
Merge pull request !2059 from yanghaitao/yht_fix_subset_samplers
This commit is contained in:
commit
9282b9473d
|
@ -506,6 +506,9 @@ class SubsetRandomSampler(BuiltinSampler):
|
|||
|
||||
def get_num_samples(self):
|
||||
num_samples = super().get_num_samples()
|
||||
if num_samples is None:
|
||||
return len(self.indices)
|
||||
|
||||
return min(len(self.indices), num_samples)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue