Solved by Nikronic in post #2 
              
              
                Hi, 
shape actually is an attribute for tensors or numpy arrays, if you are interested in adding any attribute to your classes, just define self.shape. Here is an example: 

class MyDataset(data.Dataset):
    def __init__(self, data, window):
        self.data = data
        self.window = window
   …