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
        self.shape = self.__getshape__()

    def __getitem__(self, index):
        x = self.data[index:index+self.window]
        return x

    def __len__(self):
        return len(self.data) -  self.window + 1

    def __getshape__(self):
        return (self.__len__(), *self.__getitem__(0)[0].shape)

x_train = np.random.randn(6000, 1, 32, 32)

my_data = MyDataset(x_train, 1)

Bests