Skip to content

Commit 6a309a4

Browse files
Apply suggestions from code review
Co-authored-by: Alexander Dokuchaev <[email protected]>
1 parent 0806286 commit 6a309a4

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/nncf/common/graph/graph.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -812,13 +812,14 @@ def find_matching_subgraphs(self, patterns: GraphPattern, strict: bool = True) -
812812
return output
813813

814814

815-
def get_ignored_names_by_ignored_patterns(nncf_graph: NNCFGraph, ignored_patterns: GraphPattern) -> set[str]:
815+
def get_node_names_matching_graph_pattern(nncf_graph: NNCFGraph, graph_pattern: GraphPattern) -> set[str]:
816816
"""
817-
Returns node names matched ignored_patterns.
817+
Returns the names of nodes in the given NNCFGraph that match the specified graph pattern.
818818
819-
:param nncf_graph: NNCFGraph instance.
820-
:param ignored_patterns: Ignored patterns.
821-
:return: A set of NNCF node names from the given NNCFGraph matched ignored_patterns.
819+
:param nncf_graph: An instance of NNCFGraph to search for matching subgraphs.
820+
:param graph_pattern: A GraphPattern instance used to identify matching subgraphs.
821+
:return: A set of node names from the NNCFGraph that match the given graph pattern.
822+
"""
822823
"""
823824
nncf_node_names = set()
824825
for subgraph in nncf_graph.find_matching_subgraphs(ignored_patterns, strict=False):

src/nncf/quantization/algorithms/weight_compression/algorithm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,10 +385,10 @@ def get_nodes_to_compress(self, nncf_graph: NNCFGraph) -> list[NNCFNode]:
385385
self._ignored_scope, nncf_graph, strict=self._ignored_scope.validate
386386
)
387387

388-
ignored_patterns_names = get_ignored_names_by_ignored_patterns(
388+
autogenerated_ignored_names = get_node_names_matching_graph_pattern(
389389
nncf_graph, self._backend_entity.get_ignored_patterns()
390390
)
391-
ignored_names = ignored_names.union(ignored_patterns_names)
391+
ignored_names = ignored_names.union(autogenerated_ignored_names)
392392

393393
for node in nncf_graph.topological_sort():
394394
is_node_with_weights = self._backend_entity.is_node_with_weights(node, nncf_graph)

0 commit comments

Comments
 (0)