def gen_all_nets()

in LaNAS/LaNet/CIFAR10/nasnet_set.py [0:0]


def gen_all_nets(max_node=Max_node):
    block = []
    all_connections = []
    for i in range(max_node):
        connections = []
        for j in range(i+2):
            connections.append(j)
        all_connections.append(connections)
    b = [[] for i in range(max_node)]

    for i in range(max_node):
        for left_type in range(len(operations)):
            for right_type in range(len(operations)):
                for left_input in all_connections[i]:
                    for right_input in all_connections[i]:
                        if [right_type, left_type, left_input, right_input] not in b[i]:
                            b[i].append([left_type, right_type, left_input, right_input])

    sample_nums = 1
    for i in range(max_node):
        sample_nums *= len(b[i])

    print(sample_nums)
    for o in b[0]:
        for t in b[1]:
            for th in b[2]:
                for f in b[3]:
                    if edit_distance([o, t, th, f], root) == 6:
                        block.append([o, t, th, f])

    # for i in block:
    #     print(i)
    print(len(block))

    return block