Skip to content

Commit

Permalink
Fix bug of cycling nums
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhangcs committed May 31, 2023
1 parent d35fd45 commit 5833ee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion supar/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def cycle(length):
for i in range_fn(length).tolist():
yield i

for i in cycle(range(len(self.buckets))):
for i in cycle(len(self.buckets)):
bucket = self.buckets[i]
split_sizes = [(len(bucket) - j - 1) // self.n_batches[i] + 1 for j in range(self.n_batches[i])]
# DON'T use `torch.chunk` which may return wrong number of batches
Expand Down

0 comments on commit 5833ee8

Please sign in to comment.