Skip to content

Commit c935d29

Browse files
committed
Implement Victor's feedback
1 parent cc329a6 commit c935d29

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Deeploy/DeeployTypes.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import os
1010
import pickle
1111
import re
12+
import time
1213
from abc import abstractmethod
1314
from collections import OrderedDict, deque
1415
from dataclasses import dataclass
@@ -2251,9 +2252,11 @@ def optimize(self, graph: gs.Graph) -> Tuple[gs.Graph]:
22512252
22522253
"""
22532254
for _pass in self.passes:
2254-
log.debug(f" - Apply {_pass.__class__.__name__}")
2255+
start_time = time.perf_counter()
22552256
graph = _pass.apply(graph)
22562257
graph.cleanup().toposort()
2258+
end_time = time.perf_counter()
2259+
log.debug(f" - Applied {_pass.__class__.__name__} ({(end_time - start_time)*1E3:.3f} ms)")
22572260
return graph
22582261

22592262

@@ -2700,6 +2703,7 @@ def parse(self, default_channels_first: bool = True) -> bool:
27002703
deepestIdx = 0
27012704

27022705
log.debug(" - Parse and Type Check Network")
2706+
start_time = time.perf_counter()
27032707

27042708
iteration_main = 0
27052709
iteration_sub = 0
@@ -2769,8 +2773,10 @@ def parse(self, default_channels_first: bool = True) -> bool:
27692773
iteration_tot += 1
27702774
log.debug(31 * "-" + f" SUB ITERATION {iteration_main}.{iteration_sub:<2} " + 31 * "-")
27712775

2776+
end_time = time.perf_counter()
27722777
log.info(
2773-
f" {SUCCESS_MARK} Parsed network with {len(self.layerBinding)} layers after {iteration_tot} iterations")
2778+
f" {SUCCESS_MARK} Parsed network with {len(self.layerBinding)} layers after {iteration_tot} iterations in {(end_time-start_time)*1E3:.3f} ms"
2779+
)
27742780
self.ctxt = ctxt
27752781
self.parsed = True
27762782
return True

0 commit comments

Comments
 (0)