You can define the targets as you wish. 
The DataLoader is not responsible for the data and target creation, but allows you to automatically create batches, use multiprocessing to load the data in the background, use custom samplers, shuffle the dataset etc.
The Dataset defines how the data and target samples are created.
torchvision.datasets provide some “standard approaches”, such as ImageFolder, which creates the targets based on the subfolders passed in the root argument (subfolders will be sorted and each folder will get an own class label).
However, this use case might be too limited for your use case, so that I would recommend to implement a custom Dataset.
This tutorial 222 gives you a good overview on creating a Dataset and use a DataLoader.
As described, the __getitem__ method would be responsible to load the data and target (or create the target based on some properties).
Before changing the data structure, let’s think about how the batches should be created.
I.e. would it be possible to create a batch given a single index using the current data structure?