Thank you for your kind reply…For demo purpose I am adding a demo code.
class my_custom_dataset(torch.utils.data.Dataset):
  def __init__(self,data=None):
    self.data = data
    
    self.features_data = torch.from_numpy(np.random.randn(70000, 2048)).float()
    self.labels_data = torch.from_numpy(np.random.randint(0,10,(70000,))).long()

    
  def __getitem__(self, index):
    data = self.features_data[index]
    target = self.labels_data[index]
    tr_data, tr_target = self.data[index]
        
    return data,  target, tr_data, tr_target

  def __len__(self):
      
    return len(self.features_data)    

train_dataset = torchvision.datasets.CIFAR10(root=’./data’, train=True, download=True, transform=transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))]))
test_dataset = torchvision.datasets.CIFAR10(root=’./data’, train=False, download=True, transform=transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))]))
total_dataset = train_dataset + test_dataset
custom_set = my_custom_dataset(data= total_dataset)
custom_loader = torch.utils.data.DataLoader(custom_set, batch_size=128, shuffle=False, num_workers=2)
data_, label, tr_data, tr_target = iter(custom_loader).next()
print(label[:20])
print(tr_target[:20])
print(data_.size())
print(tr_data.size())
I have sent a demo code above. Please check the code.