molecules is an instance of a class I called MoleclesLoader. Here is the code:
class MoleculesLoader(Dataset):
    """ Pytorch Dataloader Class for qm9 dataset."""

    def __init__(self, destpath):
        """
        :param destpath: Path to the .npz database previously created
        """
        self.destpath = destpath
        with np.load(self.destpath) as data:
            self.len = len(data['numbers'])
            numbers = data['numbers']
            position = data['distances']
            energy = data['energies']
            sample = {'Atomic Numbers': numbers, 'Distance Matrix': position, 'U_0 Energy': energy}
            X = np.array(list(zip(list(numbers), list(position), list(energy))))

        #  input
        self.x_data =np.dstack((X[:,0],X[:,1]))[0]  # (133885, 2)
        #  labels
        self.y_data = X[:,2]  # (133885,)

    def __getitem__(self, index):

        return self.x_data[index], self.y_data[index]

    #  x_data[index] -> (2,) array
    #   x_data[index][0] = shape (29,)
    #   x_data[index][1] = shape (29,29)
    #  y_data[index] -> () int

    def __len__(self):
        return self.len