Skip to content

Commit ab69efb

Browse files
irenabirenab
authored andcommitted
add missing type hints
1 parent 07c9486 commit ab69efb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

model_compression_toolkit/core/common/mixed_precision/mixed_precision_search_manager.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from tqdm import tqdm
1919

20-
from typing import Dict, List
20+
from typing import Dict, List, Tuple
2121

2222
import numpy as np
2323

@@ -199,7 +199,7 @@ def _build_sensitivity_mapping(self, eps: float = EPS) -> Dict[int, Dict[int, fl
199199

200200
return layer_to_metrics_mapping
201201

202-
def _get_mp_graph(self, graph, target_resource_utilization):
202+
def _get_mp_graph(self, graph: Graph, target_resource_utilization: ResourceUtilization) -> Tuple[Graph, bool]:
203203
"""
204204
Get graph for mixed precision search. Virtual graph is built if bops is restricted and both activation and
205205
weights are configurable.
@@ -209,7 +209,8 @@ def _get_mp_graph(self, graph, target_resource_utilization):
209209
target_resource_utilization: target resource utilization.
210210
211211
Returns:
212-
Graph for mixed precision search (virtual or original).
212+
Graph for mixed precision search (virtual or original), and a boolean flag whether a virtual graph has been
213+
constructed.
213214
"""
214215
if (target_resource_utilization.bops_restricted() and
215216
graph.has_any_configurable_activation() and

0 commit comments

Comments
 (0)