Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 72f7b4b

Browse files
HarshTrivedimatt-gardner
authored andcommitted
Remove bucket iterator shuffle warning. (#1742)
* Remove bucket iterator shuffle warning. From discussion here: #1578. Let me know if I should remove the code instead of commenting it. * Remove the warning and add comment instead. * Add a period.
1 parent 8bbde0d commit 72f7b4b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

allennlp/data/iterators/bucket_iterator.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,9 @@ def _create_batches(self, instances: Iterable[Instance], shuffle: bool) -> Itera
126126
last_batch = batches.pop()
127127
penultimate_batch = batches.pop()
128128
if shuffle:
129+
# NOTE: if shuffle is false, the data will still be in a different order
130+
# because of the bucket sorting.
129131
random.shuffle(batches)
130-
else:
131-
logger.warning("shuffle parameter is set to False,"
132-
" while bucket iterators by definition change the order of your data.")
133132
if move_to_front:
134133
batches.insert(0, penultimate_batch)
135134
batches.insert(0, last_batch)

0 commit comments

Comments
 (0)