forked from mindspore-Ecosystem/mindspore
fix SubsetSampler
This commit is contained in:
parent
a6a9f88453
commit
5b0fb71343
|
@ -457,6 +457,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