pull/112/head
LXXXXR 2020-12-04 11:41:49 +08:00 committed by GitHub
parent 400074c321
commit 92438da12a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -29,7 +29,9 @@ class DistributedSampler(_DistributedSampler):
# add extra samples to make it evenly divisible
if self.round_up:
indices += indices[:(self.total_size - len(indices))]
indices = (
indices *
int(self.total_size / len(indices) + 1))[:self.total_size]
assert len(indices) == self.total_size
# subsample