We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f695d01 + 088093d commit 102763aCopy full SHA for 102763a
1 file changed
profold2/data/dataset.py
@@ -2021,6 +2021,7 @@ def _split_args(args):
2021
if 'weights' in kwargs:
2022
weights = kwargs.pop('weights')
2023
if weights:
2024
+ assert len(dataset) == len(weights)
2025
kwargs['sampler'] = WeightedRandomSampler(weights, num_samples=len(weights))
2026
if 'shuffle' in kwargs:
2027
kwargs.pop('shuffle')
0 commit comments