@@ -65,7 +65,6 @@ def _atexit_print_fn():
65
65
destination_file = config .profiling__destination
66
66
67
67
with extended_open (destination_file , mode = "w" ):
68
-
69
68
# Reverse sort in the order of compile+exec time
70
69
for ps in sorted (
71
70
_atexit_print_list , key = lambda a : a .compile_time + a .fct_call_time
@@ -358,7 +357,7 @@ def class_impl(self):
358
357
"""
359
358
# timing is stored by node, we compute timing by class on demand
360
359
rval = {}
361
- for ( fgraph , node ) in self .apply_callcount :
360
+ for fgraph , node in self .apply_callcount :
362
361
typ = type (node .op )
363
362
if self .apply_cimpl [node ]:
364
363
impl = "C "
@@ -401,7 +400,7 @@ def compute_total_times(self):
401
400
402
401
"""
403
402
rval = {}
404
- for ( fgraph , node ) in self .apply_time :
403
+ for fgraph , node in self .apply_time :
405
404
if node not in rval :
406
405
self .fill_node_total_time (fgraph , node , rval )
407
406
return rval
@@ -437,7 +436,7 @@ def op_impl(self):
437
436
"""
438
437
# timing is stored by node, we compute timing by Op on demand
439
438
rval = {}
440
- for ( fgraph , node ) in self .apply_callcount :
439
+ for fgraph , node in self .apply_callcount :
441
440
if self .apply_cimpl [node ]:
442
441
rval [node .op ] = "C "
443
442
else :
@@ -711,7 +710,7 @@ def summary_nodes(self, file=sys.stderr, N=None):
711
710
712
711
atimes .sort (reverse = True , key = lambda t : (t [1 ], t [3 ]))
713
712
tot = 0
714
- for ( f , t , a , nd_id , nb_call ) in atimes [:N ]:
713
+ for f , t , a , nd_id , nb_call in atimes [:N ]:
715
714
tot += t
716
715
ftot = tot * 100 / local_time
717
716
if nb_call == 0 :
@@ -840,7 +839,7 @@ def summary_memory(self, file, N=None):
840
839
var_mem = {} # variable->size in bytes; don't include input variables
841
840
node_mem = {} # (fgraph, node)->total outputs size (only dense outputs)
842
841
843
- for ( fgraph , node ) in self .apply_callcount :
842
+ for fgraph , node in self .apply_callcount :
844
843
fct_memory .setdefault (fgraph , {})
845
844
fct_memory [fgraph ].setdefault (node , [])
846
845
fct_shapes .setdefault (fgraph , {})
@@ -1610,7 +1609,7 @@ def exp_float32_op(op):
1610
1609
printed_tip = True
1611
1610
1612
1611
# tip 4
1613
- for ( fgraph , a ) in self .apply_time :
1612
+ for fgraph , a in self .apply_time :
1614
1613
node = a
1615
1614
if isinstance (node .op , Dot ) and all (
1616
1615
len (i .type .broadcastable ) == 2 for i in node .inputs
@@ -1630,7 +1629,7 @@ def exp_float32_op(op):
1630
1629
# The tip was about MRG_RandomStream which is removed
1631
1630
1632
1631
# tip 6
1633
- for ( fgraph , a ) in self .apply_time :
1632
+ for fgraph , a in self .apply_time :
1634
1633
node = a
1635
1634
if isinstance (node .op , Dot ) and len ({i .dtype for i in node .inputs }) != 1 :
1636
1635
print (
0 commit comments