Make datasets in `ConcatDataset` not need to be sized (#64114)
authorSantiago Castro <sacastro@umich.edu>
Wed, 1 Sep 2021 22:18:14 +0000 (15:18 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 1 Sep 2021 22:32:50 +0000 (15:32 -0700)
commit69f4401b7b6ea6a51a090ca8c958968a80a529e2
tree826ee87a0c904ecfe93de24649179ef82ea54647
parent535526b95cb26be10c0942129911db7d281d5bd9
Make datasets in `ConcatDataset` not need to be sized (#64114)

Summary:
`datasets` needs to be iterable, but also sized because the length is checked. But immediately after it's converted to a list. By changing the order of these 2 lines, it doesn't need to be sized anymore.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/64114

Reviewed By: H-Huang

Differential Revision: D30641480

Pulled By: ejguan

fbshipit-source-id: 7e16548c2123afa65b83845f9929271fa07fe1e8
torch/utils/data/dataset.py