Skip to content

Commit

Permalink
python: Remove the option of not merging child graph into parent.
Browse files Browse the repository at this point in the history
  • Loading branch information
yaoyuannnn committed Jul 29, 2020
1 parent 1050e19 commit 1c4e84f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions smaug/python/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(
# This proto stores all the parameters in the network.
self.tensor_data_array = tensor_pb2.TensorDataArray()
self._parent_graph = None
self._merge_into_parent_graph = True

def __enter__(self):
self._parent_graph = global_vars.get_graph()
Expand All @@ -34,7 +33,7 @@ def __enter__(self):

def __exit__(self, *args):
# Merge the graph into its parent if it exists.
if self._parent_graph is not None and self._merge_into_parent_graph:
if self._parent_graph is not None:
self._parent_graph.merge(self)
global_vars.set_graph(self._parent_graph)

Expand All @@ -46,14 +45,6 @@ def backend(self):
def mem_policy(self):
return self.graph.mem_policy

@property
def merge_into_parent_graph(self):
return self._merge_into_parent_graph

@merge_into_parent_graph.setter
def merge_into_parent_graph(self, merge):
self._merge_into_parent_graph = merge

@property
def layout_trans_enabled(self):
return self._layout_trans_enabled
Expand Down

0 comments on commit 1c4e84f

Please sign in to comment.