def convert_genotype_to_compact(genotype):
    """Converts Genotype to the compact representation"""
    OPS = [
        "max_pool_3x3",
        "avg_pool_3x3",
        "skip_connect",
        "sep_conv_3x3",
        "sep_conv_5x5",
        "dil_conv_3x3",
        "dil_conv_5x5",
    ]
    compact = []

    for i, cell_type in enumerate(["normal", "reduce"]):
        cell = eval("genotype." + cell_type)
        compact.append([])

        for j in range(8):
            compact[i].append((cell[j][1], OPS.index(cell[j][0])))

    compact_tuple = (tuple(compact[0]), tuple(compact[1]))
    return compact_tuple