torchdatasets
torchdatasets copied to clipboard
Multiple concatenation with logical or operator yields nested concatenation
Concatenation of two datasets with the logical operator works as intended:
concat_2 = images | images
While concatenation of more datasets (concat_3 = images | images | images
) yields a nested concatenated dataset.
The code is equivalent to:
concat_3 = torchdata.datasets.ConcatDataset([torchdata.datasets.ConcatDataset([images, images]), images])
I'd argue a more intuitive result would something that is equivalent to this instead:
concat_3 = torchdata.datasets.ConcatDataset([images, images, images])
In short, concatenating with the |
operator to an already concatenated dataset should add the new dataset in the list of concatenations, instead of creating a nested concatenated dataset.