Skip to content

concat_dataset

ConcatDataset

Bases: torch.utils.data.ConcatDataset

Exactly the same as torch.utils.data.ConcatDataset except with a nice __repr__ function.

Source code in pytorch_adapt\datasets\concat_dataset.py
 6
 7
 8
 9
10
11
12
13
14
class ConcatDataset(torch.utils.data.ConcatDataset):
    """
    Exactly the same as ```torch.utils.data.ConcatDataset```
    except with a nice ```__repr__``` function.
    """

    def __repr__(self):
        extra_repr = f"len={str(self.__len__())}"
        return c_f.nice_repr(self, extra_repr, {"datasets": self.datasets})