Skip to content

Commit

Permalink
assert systems and batch sizes have the same length
Browse files Browse the repository at this point in the history
  • Loading branch information
CaRoLZhangxy committed Mar 28, 2024
1 parent a16d133 commit 503c398
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions deepmd/pt/utils/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def construct_dataset(system):
self.batch_sizes = batch_size

Check warning on line 125 in deepmd/pt/utils/dataloader.py

View check run for this annotation

Codecov / codecov/patch

deepmd/pt/utils/dataloader.py#L125

Added line #L125 was not covered by tests
else:
self.batch_sizes = batch_size * np.ones(len(systems), dtype=int)
assert len(self.systems) == len(self.batch_sizes)
for system, batch_size in zip(self.systems, self.batch_sizes):
if dist.is_initialized():
system_sampler = DistributedSampler(system)
Expand Down

0 comments on commit 503c398

Please sign in to comment.