nncf/experimental/torch/search_building_blocks/search_blocks.py
def check_blocks_combination_is_block(block: PotentialBuildingBlock,
                                      combination: Tuple[PotentialBuildingBlock]) -> bool:
    """
    Checks that a combination of blocks is a given block.
    """
    if block.start_node.main_id != combination[0].start_node.main_id:
        return False
    if block.end_node.bottom_id != combination[-1].end_node.bottom_id:
        return False
    i = 0
    while i < len(combination) - 1:
        curr_end_node = combination[i].end_node
        next_start_node = combination[i + 1].start_node
        if curr_end_node.node_key in next_start_node.node_key:
            i += 1
            continue
        return False
    return True

    Checks that a combination of blocks is a given block.
    
Checks that a combination of blocks is a given block.
Checks that a combination of blocks is a given block .
def check_blocks_combination_is_block(block: PotentialBuildingBlock,
                                      combination: Tuple[PotentialBuildingBlock]) -> bool:
    if block.start_node.main_id != combination[0].start_node.main_id:
        return False
    if block.end_node.bottom_id != combination[-1].end_node.bottom_id:
        return False
    i = 0
    while i < len(combination) - 1:
        curr_end_node = combination[i].end_node
        next_start_node = combination[i + 1].start_node
        if curr_end_node.node_key in next_start_node.node_key:
            i += 1
            continue
        return False
    return True
def check_blocks_combination_is_block ( block : PotentialBuildingBlock , combination : Tuple [ PotentialBuildingBlock ] ) -> bool : if block . start_node . main_id != combination [ 0 ] . start_node . main_id : return False if block . end_node . bottom_id != combination [ - 1 ] . end_node . bottom_id : return False i = 0 while i < len ( combination ) - 1 : curr_end_node = combination [ i ] . end_node next_start_node = combination [ i + 1 ] . start_node if curr_end_node . node_key in next_start_node . node_key : i += 1 continue return False return True
Checks that a combination of blocks is a given block.
Checks that a combination of blocks is a given block .
"""
    Checks that a combination of blocks is a given block.
    """
block
PotentialBuildingBlock
combination
Tuple[PotentialBuildingBlock]