(arch, info, name)
arch = [{block_0}, {block_1}, ...]
        info = [
            # stage 0
            [
                block0_info,
                block1_info,
                ...
            ], ...
        ]
        convert to:
        arch = [
            {
                block_0,
                name: block0_info,
            },
            {
                block_1,
                name: block1_info,
            }, ...
        ]
arch = [{block_0}, {block_1}, ...]
        info = [
            # stage 0
            [
                block0_info,
                block1_info,
                ...
            ], ...
        ]
        convert to:
        arch = [
            {
                block_0,
                name: block0_info,
            },
            {
                block_1,
                name: block1_info,
            }, ...
        ]
arch = [ { block_0 } { block_1 } ... ] info = [ # stage 0 [ block0_info block1_info ... ] ... ] convert to : arch = [ { block_0 name : block0_info } { block_1 name : block1_info } ... ]
def _add_to_arch(arch, info, name):
    """ arch = [{block_0}, {block_1}, ...]
        info = [
            # stage 0
            [
                block0_info,
                block1_info,
                ...
            ], ...
        ]
        convert to:
        arch = [
            {
                block_0,
                name: block0_info,
            },
            {
                block_1,
                name: block1_info,
            }, ...
        ]
    """
    assert isinstance(arch, list) and all(isinstance(x, dict) for x in arch)
    assert isinstance(info, list) and all(isinstance(x, list) for x in info)
    idx = 0
    for stage_idx, stage in enumerate(info):
        for block_idx, block in enumerate(stage):
            assert (
                arch[idx]["stage_idx"] == stage_idx
                and arch[idx]["block_idx"] == block_idx
            ), "Index ({}, {}) does not match for block {}".format(
                stage_idx, block_idx, arch[idx]
            )
            assert name not in arch[idx]
            arch[idx][name] = block
            idx += 1
def _add_to_arch ( arch , info , name ) : assert isinstance ( arch , list ) and all ( isinstance ( x , dict ) for x in arch ) assert isinstance ( info , list ) and all ( isinstance ( x , list ) for x in info ) idx = 0 for stage_idx , stage in enumerate ( info ) : for block_idx , block in enumerate ( stage ) : assert ( arch [ idx ] [ "stage_idx" ] == stage_idx and arch [ idx ] [ "block_idx" ] == block_idx ) , "Index ({}, {}) does not match for block {}" . format ( stage_idx , block_idx , arch [ idx ] ) assert name not in arch [ idx ] arch [ idx ] [ name ] = block idx += 1