nncf/common/pruning/utils.py
def count_filters_num(graph: NNCFGraph,
                      op_metatypes: List[Type[OperatorMetatype]],
                      output_channels: Dict[NNCFNodeName, int] = None) -> int:
    """
    Counts filters of `op_metatypes` layers taking into account new output channels number.

    :param graph: Graph to work with.
    :param op_metatypes: List of metatypes defining convolution operations.
    :param output_channels:  A dictionary of output channels number in pruned model.
    :return: Current number of filters according to given graph and output channels.
    """
    filters_num = 0
    output_channels = output_channels or {}
    for node in graph.get_nodes_by_metatypes(op_metatypes):
        filters_num += output_channels.get(node.node_name, get_output_channels(node))
    return filters_num

    Counts filters of `op_metatypes` layers taking into account new output channels number.

    :param graph: Graph to work with.
    :param op_metatypes: List of metatypes defining convolution operations.
    :param output_channels:  A dictionary of output channels number in pruned model.
    :return: Current number of filters according to given graph and output channels.
    
Counts filters of `op_metatypes` layers taking into account new output channels number.
Counts filters of ` op_metatypes ` layers taking into account new output channels number .
def count_filters_num(graph: NNCFGraph,
                      op_metatypes: List[Type[OperatorMetatype]],
                      output_channels: Dict[NNCFNodeName, int] = None) -> int:
    filters_num = 0
    output_channels = output_channels or {}
    for node in graph.get_nodes_by_metatypes(op_metatypes):
        filters_num += output_channels.get(node.node_name, get_output_channels(node))
    return filters_num
def count_filters_num ( graph : NNCFGraph , op_metatypes : List [ Type [ OperatorMetatype ] ] , output_channels : Dict [ NNCFNodeName , int ] = None ) -> int : filters_num = 0 output_channels = output_channels or { } for node in graph . get_nodes_by_metatypes ( op_metatypes ) : filters_num += output_channels . get ( node . node_name , get_output_channels ( node ) ) return filters_num
Counts filters of `op_metatypes` layers taking into account new output channels number.
Counts filters of ` op_metatypes ` layers taking into account new output channels number .
"""
    Counts filters of `op_metatypes` layers taking into account new output channels number.

    :param graph: Graph to work with.
    :param op_metatypes: List of metatypes defining convolution operations.
    :param output_channels:  A dictionary of output channels number in pruned model.
    :return: Current number of filters according to given graph and output channels.
    """
Current number of filters according to given graph and output channels.
Current number of filters according to given graph and output channels .
graph
NNCFGraph
Graph to work with.
Graph to work with .
op_metatypes
List[Type[OperatorMetatype]]
List of metatypes defining convolution operations.
List of metatypes defining convolution operations .
output_channels
Dict[NNCFNodeName, int]
A dictionary of output channels number in pruned model.
A dictionary of output channels number in pruned model .