nncf/experimental/torch/search_building_blocks/search_blocks.py
def search_lin_combination(block: PotentialBuildingBlock, blocks: List[PotentialBuildingBlock]) -> bool:
    """
    Checks that a given block is linear combination of some blocks.
    A linear combination of blocks is a sequence of blocks following each other in the graph
    and connected by one edge.
    """
    max_num = len(blocks)
    for i in range(max_num, 1, -1):
        all_combinations = list(combinations(blocks, i))
        for combo in all_combinations:
            if check_blocks_combination_is_block(block, combo):
                return True
    return False

    Checks that a given block is linear combination of some blocks.
    A linear combination of blocks is a sequence of blocks following each other in the graph
    and connected by one edge.
    
Checks that a given block is linear combination of some blocks.
A linear combination of blocks is a sequence of blocks following each other in the graph
and connected by one edge.
Checks that a given block is linear combination of some blocks . A linear combination of blocks is a sequence of blocks following each other in the graph and connected by one edge .
def search_lin_combination(block: PotentialBuildingBlock, blocks: List[PotentialBuildingBlock]) -> bool:
    max_num = len(blocks)
    for i in range(max_num, 1, -1):
        all_combinations = list(combinations(blocks, i))
        for combo in all_combinations:
            if check_blocks_combination_is_block(block, combo):
                return True
    return False
def search_lin_combination ( block : PotentialBuildingBlock , blocks : List [ PotentialBuildingBlock ] ) -> bool : max_num = len ( blocks ) for i in range ( max_num , 1 , - 1 ) : all_combinations = list ( combinations ( blocks , i ) ) for combo in all_combinations : if check_blocks_combination_is_block ( block , combo ) : return True return False
Checks that a given block is linear combination of some blocks.
Checks that a given block is linear combination of some blocks .
"""
    Checks that a given block is linear combination of some blocks.
    A linear combination of blocks is a sequence of blocks following each other in the graph
    and connected by one edge.
    """
block
PotentialBuildingBlock
blocks
List[PotentialBuildingBlock]