Skip to content

Commit

Permalink
Revert D15511921: [pytorch][PR] BatchSampler now uses list.clear() in…
Browse files Browse the repository at this point in the history
…stead of creating new objects

Differential Revision:
D15511921

Original commit changeset: e943d21e75e1

fbshipit-source-id: 933b7ef74c7a530f0a2cc087c8ee6f0455cf9239
  • Loading branch information
soumith authored and facebook-github-bot committed May 27, 2019
1 parent 482ae8e commit 6480d3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/utils/data/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def __iter__(self):
batch.append(idx)
if len(batch) == self.batch_size:
yield batch
batch.clear()
batch = []
if len(batch) > 0 and not self.drop_last:
yield batch

Expand Down

0 comments on commit 6480d3f

Please sign in to comment.