Solved by neem-41 in post #4 
              
              
                Hi @Tupakula_Mallikarjun, 
I fixed two things in my code. In my constructor on Data class I had forgotten to call super. So i added this in the code: 
class Data(Dataset):
 def __init__(self,d,transforms=None):
  super().__init__()
  self.transforms = transforms
  self.data = mat73.loadmat(d)

Then …