File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 99import os
1010import pickle
1111import re
12+ import time
1213from abc import abstractmethod
1314from collections import OrderedDict , deque
1415from 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
You can’t perform that action at this time.
0 commit comments