nncf/common/pruning/node_selector.py
def _is_module_prunable(self, graph: NNCFGraph, node: NNCFNode) -> PruningAnalysisDecision:
        """
        Check whether we should prune module corresponding to provided node
        according to algorithm parameters.

        :param graph: Graph to work with.
        :param node: Node to check.
        :return: Pruning analysis decision.
        """
        stop_propagation_ops = self._stop_propagation_op_metatype.get_all_op_aliases()
        types_to_track = self._prune_operations_types + stop_propagation_ops
        input_non_pruned_nodes = get_first_nodes_of_type(graph, types_to_track)
        node_name = node.node_name

        if not should_consider_scope(node_name, self._ignored_scopes, self._target_scopes):
            return PruningAnalysisDecision(False, PruningAnalysisReason.IGNORED_SCOPE)

        if not self._prune_first and node in input_non_pruned_nodes:
            return PruningAnalysisDecision(False, PruningAnalysisReason.FIRST_CONV)

        if is_grouped_conv(node) and not is_prunable_depthwise_conv(node):
            return PruningAnalysisDecision(False, PruningAnalysisReason.GROUP_CONV)

        if not self._prune_downsample_convs and is_conv_with_downsampling(node):
            return PruningAnalysisDecision(False, PruningAnalysisReason.DOWNSAMPLE_CONV)

        return PruningAnalysisDecision(True)

        Check whether we should prune module corresponding to provided node
        according to algorithm parameters.

        :param graph: Graph to work with.
        :param node: Node to check.
        :return: Pruning analysis decision.
        
Check whether we should prune module corresponding to provided node
according to algorithm parameters.
Check whether we should prune module corresponding to provided node according to algorithm parameters .
def _is_module_prunable(self, graph: NNCFGraph, node: NNCFNode) -> PruningAnalysisDecision:
        stop_propagation_ops = self._stop_propagation_op_metatype.get_all_op_aliases()
        types_to_track = self._prune_operations_types + stop_propagation_ops
        input_non_pruned_nodes = get_first_nodes_of_type(graph, types_to_track)
        node_name = node.node_name
        if not should_consider_scope(node_name, self._ignored_scopes, self._target_scopes):
            return PruningAnalysisDecision(False, PruningAnalysisReason.IGNORED_SCOPE)
        if not self._prune_first and node in input_non_pruned_nodes:
            return PruningAnalysisDecision(False, PruningAnalysisReason.FIRST_CONV)
        if is_grouped_conv(node) and not is_prunable_depthwise_conv(node):
            return PruningAnalysisDecision(False, PruningAnalysisReason.GROUP_CONV)
        if not self._prune_downsample_convs and is_conv_with_downsampling(node):
            return PruningAnalysisDecision(False, PruningAnalysisReason.DOWNSAMPLE_CONV)
        return PruningAnalysisDecision(True)
def _is_module_prunable ( self , graph : NNCFGraph , node : NNCFNode ) -> PruningAnalysisDecision : stop_propagation_ops = self . _stop_propagation_op_metatype . get_all_op_aliases ( ) types_to_track = self . _prune_operations_types + stop_propagation_ops input_non_pruned_nodes = get_first_nodes_of_type ( graph , types_to_track ) node_name = node . node_name if not should_consider_scope ( node_name , self . _ignored_scopes , self . _target_scopes ) : return PruningAnalysisDecision ( False , PruningAnalysisReason . IGNORED_SCOPE ) if not self . _prune_first and node in input_non_pruned_nodes : return PruningAnalysisDecision ( False , PruningAnalysisReason . FIRST_CONV ) if is_grouped_conv ( node ) and not is_prunable_depthwise_conv ( node ) : return PruningAnalysisDecision ( False , PruningAnalysisReason . GROUP_CONV ) if not self . _prune_downsample_convs and is_conv_with_downsampling ( node ) : return PruningAnalysisDecision ( False , PruningAnalysisReason . DOWNSAMPLE_CONV ) return PruningAnalysisDecision ( True )
Check whether we should prune module corresponding to provided node
according to algorithm parameters.
Check whether we should prune module corresponding to provided node according to algorithm parameters .
"""
        Check whether we should prune module corresponding to provided node
        according to algorithm parameters.

        :param graph: Graph to work with.
        :param node: Node to check.
        :return: Pruning analysis decision.
        """
Pruning analysis decision.
Pruning analysis decision .
self
graph
NNCFGraph
Graph to work with.
Graph to work with .
node
NNCFNode
Node to check.
Node to check .