Making a custom dataset like MNIST

Hello! I’m struggling with making custom datasets like MNIST.
The dimension of MNIST datasets is like torch.size [6000,2,32,32],
and 2 means that it includes the image as well as the label.

I have images with label on its image file name but I don’t know how to include image file name(label)
into one tensor, my tensor dimension is [6000,1,32,32], and it means the tensor has only image data not
the label.

how to make label within image tensor?