Never mind, it is solved:
    class My_dataset(Dataset):
        def __init__(self, *data):
            # accept variable number of arrays to construct dataset
            self._data = data

        def __len__(self):
            return len(self._data[0])

        def __getitem__(self, index):
            return [item[index] for item in self._data]