In case you have already created the data and target tensors, you could use torch.utils.data.TensorDataset to create the dataset.



 Sayyed_Ali_Mousavi:

But how should i do it? How every tensor match its label?


You, as the creator of the dataset, would have to make sure that each create data sample matches its target.