Skip to content

Commit 102763a

Browse files
authored
Merge pull request #405 from bigict/data
fix: check weights
2 parents f695d01 + 088093d commit 102763a

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

profold2/data/dataset.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,6 +2021,7 @@ def _split_args(args):
20212021
if 'weights' in kwargs:
20222022
weights = kwargs.pop('weights')
20232023
if weights:
2024+
assert len(dataset) == len(weights)
20242025
kwargs['sampler'] = WeightedRandomSampler(weights, num_samples=len(weights))
20252026
if 'shuffle' in kwargs:
20262027
kwargs.pop('shuffle')

0 commit comments

Comments
 (0)