nncf/torch/pruning/utils.py
def init_output_masks_in_graph(graph: NNCFGraph, nodes: List):
    """
    Initialize masks in graph for mask propagation algorithm

    :param graph: NNCFNetwork
    :param nodes: list with pruned nodes
    """
    for node in graph.get_all_nodes():
        node.data.pop('output_mask', None)

    for minfo in nodes:
        mask = minfo.operand.binary_filter_pruning_mask
        nncf_node = graph.get_node_by_id(minfo.nncf_node_id)
        nncf_node.data['output_mask'] = PTNNCFTensor(mask)

    Initialize masks in graph for mask propagation algorithm

    :param graph: NNCFNetwork
    :param nodes: list with pruned nodes
    
Initialize masks in graph for mask propagation algorithm
Initialize masks in graph for mask propagation algorithm
def init_output_masks_in_graph(graph: NNCFGraph, nodes: List):
    for node in graph.get_all_nodes():
        node.data.pop('output_mask', None)
    for minfo in nodes:
        mask = minfo.operand.binary_filter_pruning_mask
        nncf_node = graph.get_node_by_id(minfo.nncf_node_id)
        nncf_node.data['output_mask'] = PTNNCFTensor(mask)
def init_output_masks_in_graph ( graph : NNCFGraph , nodes : List ) : for node in graph . get_all_nodes ( ) : node . data . pop ( 'output_mask' , None ) for minfo in nodes : mask = minfo . operand . binary_filter_pruning_mask nncf_node = graph . get_node_by_id ( minfo . nncf_node_id ) nncf_node . data [ 'output_mask' ] = PTNNCFTensor ( mask )
Initialize masks in graph for mask propagation algorithm
Initialize masks in graph for mask propagation algorithm
"""
    Initialize masks in graph for mask propagation algorithm

    :param graph: NNCFNetwork
    :param nodes: list with pruned nodes
    """
graph
NNCFGraph
None
nodes
List
list with pruned nodes
list with pruned nodes