Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderDokuchaev committed Dec 24, 2024
1 parent 419c373 commit cbf5bca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions nncf/common/graph/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def node_name(self) -> NNCFNodeName:

@property
def metatype(self) -> Type[OperatorMetatype]:
return cast(OperatorMetatype, self._attributes[NNCFNode.METATYPE_ATTR])
return cast(Type[OperatorMetatype], self._attributes[NNCFNode.METATYPE_ATTR])

@property
def node_type(self) -> str:
Expand Down Expand Up @@ -259,7 +259,7 @@ def get_nodes_by_types(self, type_list: List[str]) -> List[NNCFNode]:
all_nodes_of_type.append(nncf_node)
return all_nodes_of_type

def get_nodes_by_metatypes(self, metatype_list: Collection[OperatorMetatype]) -> List[NNCFNode]:
def get_nodes_by_metatypes(self, metatype_list: Collection[Type[OperatorMetatype]]) -> List[NNCFNode]:
"""
Return a list of nodes with provided metatypes.
Expand Down
14 changes: 7 additions & 7 deletions nncf/quantization/passes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# limitations under the License.

import collections
from typing import Deque, List, TypeVar
from typing import Deque, List, Type, TypeVar

from nncf.common.graph.graph import NNCFGraph
from nncf.common.graph.graph import NNCFNode
Expand All @@ -23,9 +23,9 @@
def transform_to_inference_graph(
nncf_graph: NNCFGraph,
input_nodes: List[NNCFNode],
shapeof_metatypes: List[OperatorMetatype],
dropout_metatypes: List[OperatorMetatype],
preserved_metatypes: List[OperatorMetatype],
shapeof_metatypes: List[Type[OperatorMetatype]],
dropout_metatypes: List[Type[OperatorMetatype]],
preserved_metatypes: List[Type[OperatorMetatype]],
) -> NNCFGraph:
"""
This method contains inplace pipeline of the passes that uses to provide inference graph without constant flows.
Expand All @@ -49,7 +49,7 @@ def transform_to_inference_graph(

def find_shapeof_subgraphs(
nncf_graph: NNCFGraph,
shapeof_metatypes: List[OperatorMetatype],
shapeof_metatypes: List[Type[OperatorMetatype]],
input_nodes: List[NNCFNode],
) -> List[NNCFNode]:
"""
Expand Down Expand Up @@ -97,7 +97,7 @@ def find_shapeof_subgraphs(
def find_preserved_nodes(
graph: NNCFGraph,
shapeof_subgraphs: List[NNCFNode],
preserved_metatypes: List[OperatorMetatype],
preserved_metatypes: List[Type[OperatorMetatype]],
) -> List[NNCFNode]:
"""
:param graph: The input graph to be analyzed.
Expand Down Expand Up @@ -129,7 +129,7 @@ def find_preserved_nodes(

def remove_nodes_and_reconnect_graph(
nncf_graph: NNCFGraph,
metatypes: List[OperatorMetatype],
metatypes: List[Type[OperatorMetatype]],
) -> NNCFGraph:
"""
Removes nodes with metatypes specified by `metatypes` parameter from
Expand Down

0 comments on commit cbf5bca

Please sign in to comment.