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

Commit

Permalink
Remove bucket iterator shuffle warning. (#1742)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
HarshTrivedi authored and matt-gardner committed Sep 10, 2018
1 parent 8bbde0d commit 72f7b4b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions allennlp/data/iterators/bucket_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,9 @@ def _create_batches(self, instances: Iterable[Instance], shuffle: bool) -> Itera
last_batch = batches.pop()
penultimate_batch = batches.pop()
if shuffle:
# NOTE: if shuffle is false, the data will still be in a different order
# because of the bucket sorting.
random.shuffle(batches)
else:
logger.warning("shuffle parameter is set to False,"
" while bucket iterators by definition change the order of your data.")
if move_to_front:
batches.insert(0, penultimate_batch)
batches.insert(0, last_batch)
Expand Down

0 comments on commit 72f7b4b

Please sign in to comment.