File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,7 @@ def optimize_graph(graph):
48
48
current = copy .deepcopy (graph )
49
49
opt = factory ()
50
50
graph = opt .optimize (current )
51
- if not continue_flag :
52
- continue_flag = opt .graph_been_opt
51
+ continue_flag = continue_flag or opt .graph_been_opt
53
52
54
53
except Exception : # pylint: disable=broad-except
55
54
# if current optimizer fails, continue with other optimizers
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class GraphOptimizerBase(object):
16
16
17
17
def __init__ (self ):
18
18
self ._logger = logging .getLogger ('.' .join (__name__ .split ('.' )[:- 1 ] + [self .__class__ .__name__ ]))
19
- self .graph_been_opt = False
19
+ self ._graph_been_opt = False
20
20
21
21
@property
22
22
def logger (self ):
@@ -26,6 +26,14 @@ def logger(self):
26
26
def is_debug_mode (self ):
27
27
return utils .is_debug_mode ()
28
28
29
+ @property
30
+ def graph_been_opt (self ):
31
+ return self ._graph_been_opt
32
+
33
+ @graph_been_opt .setter
34
+ def graph_been_opt (self , value ):
35
+ self ._graph_been_opt = value
36
+
29
37
def optimize (self , graph ):
30
38
""" Optimize graph, return optimized graph. """
31
39
before = graph .dump_node_statistics ()
You can’t perform that action at this time.
0 commit comments