I find my own solution.
class NestedMetaDataset(torch.utils.data.Dataset):
    def __init__(self, load_dataset_class, classes, batch_size, **args):
        #self.datasets = [ClassDataset(load_dataset_class, cls, **args) for cls in classes]
        self.datasets = []
        self.len = 0

        for cls in classes:
            cls_data = ClassDataset(load_dataset_class, cls, **args)
            self.len += len(cls_data)
            self.datasets.append(iter(cls_data))

        self.class_num = len(classes)
    
    def __len__(self):
        return self.len
        
    def __getitem__(self, index):
        class_id = index % len(self.datasets)
        dataset = self.datasets[class_id]
        item = next(dataset)
        
        return item
        
class ClassDataset:
    def __init__(self, load_dataset_class, class_name, **kargs):
        self.items = load_dataset_class(class_name=class_name, **kargs)

    
    def __len__(self):
        return len(self.items)
    
    def __getitem__(self, index):
        item = self.items[index]
        
        return item