Hi Konpat,
As I replied to ptrblck, I attached my codes and my explanation on the codes above for your reference.
I just follow an online tutorial to get (320,320) numpy array firstly, and increase one dimension for each sample to (1,320,320) and convert them into 3 channels (3,320,320) and then concatenate all samples (# of total samples, 3, 320, 320).
And then convert (# of total samples, 3, 320, 320) from dtype=unit 16 to int16 in order to be dealt in pytorch and convert is type from numpy array to torch tensor.
After that, I use **utils.TensorDataset ** and SubsetRandomSampler to call

train_loader = torch.utils.data.DataLoader(Prostate3T_dataset, batch_size=batch_size, sampler=train_sampler)

Any suggestion is appreciated!
Thank you very much!
Best,
Peter