nncf/experimental/torch/search_building_blocks/search_blocks.py
def restore_node_name_in_orig_graph(building_blocks: List[PotentialBuildingBlock],
                                    orig_graph: PTNNCFGraph) -> Tuple[BuildingBlocks, OrdinalIDs]:
    """
    Restore the original names and ids of the start and end of the block in original graph.
    """
    building_block_in_orig_format = []
    ordinal_ids = []
    for block in building_blocks:
        id_st = block.start_node.bottom_id  # dummy node
        id_end = block.end_node.bottom_id
        block_in_orig_format = BuildingBlock(orig_graph.get_node_key_by_id(id_st).split(' ')[-1],
                                             orig_graph.get_node_key_by_id(id_end).split(' ')[-1])
        building_block_in_orig_format.append(block_in_orig_format)
        ordinal_ids.append([id_st, id_end])
    return building_block_in_orig_format, ordinal_ids

    Restore the original names and ids of the start and end of the block in original graph.
    
Restore the original names and ids of the start and end of the block in original graph.
Restore the original names and ids of the start and end of the block in original graph .
def restore_node_name_in_orig_graph(building_blocks: List[PotentialBuildingBlock],
                                    orig_graph: PTNNCFGraph) -> Tuple[BuildingBlocks, OrdinalIDs]:
    building_block_in_orig_format = []
    ordinal_ids = []
    for block in building_blocks:
        id_st = block.start_node.bottom_id  
        id_end = block.end_node.bottom_id
        block_in_orig_format = BuildingBlock(orig_graph.get_node_key_by_id(id_st).split(' ')[-1],
                                             orig_graph.get_node_key_by_id(id_end).split(' ')[-1])
        building_block_in_orig_format.append(block_in_orig_format)
        ordinal_ids.append([id_st, id_end])
    return building_block_in_orig_format, ordinal_ids
def restore_node_name_in_orig_graph ( building_blocks : List [ PotentialBuildingBlock ] , orig_graph : PTNNCFGraph ) -> Tuple [ BuildingBlocks , OrdinalIDs ] : building_block_in_orig_format = [ ] ordinal_ids = [ ] for block in building_blocks : id_st = block . start_node . bottom_id id_end = block . end_node . bottom_id block_in_orig_format = BuildingBlock ( orig_graph . get_node_key_by_id ( id_st ) . split ( ' ' ) [ - 1 ] , orig_graph . get_node_key_by_id ( id_end ) . split ( ' ' ) [ - 1 ] ) building_block_in_orig_format . append ( block_in_orig_format ) ordinal_ids . append ( [ id_st , id_end ] ) return building_block_in_orig_format , ordinal_ids
Restore the original names and ids of the start and end of the block in original graph.
Restore the original names and ids of the start and end of the block in original graph .
"""
    Restore the original names and ids of the start and end of the block in original graph.
    """ # dummy node
building_blocks
List[PotentialBuildingBlock]
orig_graph
PTNNCFGraph