Skip to content

Commit

Permalink
returned back to old API
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-esir committed Jul 23, 2020
1 parent b4a00e8 commit baf2b02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions model-optimizer/mo/front/kaldi/loader/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def load_parallel_component(file_descr, graph: Graph, prev_layer_id):
variadic_split_node = AttributedVariadicSplit(graph, attrs).create_node()
prev_layer_node = Node(graph, prev_layer_id)
prev_layer_node.add_output_port(0)
prev_layer_node.out_port(0).connect(variadic_split_node.in_port(0))
graph.create_edge(prev_layer_node, variadic_split_node, 0, 0)

concat_id = graph.unique_id(prefix='Concat')
graph.add_node(concat_id, parameters=None, op='concat', kind='op')
Expand All @@ -87,8 +87,8 @@ def load_parallel_component(file_descr, graph: Graph, prev_layer_id):
for i, (input_node, output_node) in enumerate(zip(inputs, outputs)):
output_node.add_output_port(0)
concat_node.add_input_port(i)
output_node.out_port(0).connect(concat_node.in_port(i))
variadic_split_node.out_port(i).connect(input_node.in_port(0))
graph.create_edge(output_node, concat_node, 0, i)
graph.create_edge(variadic_split_node, input_node, i, 0)
return concat_id


Expand Down
4 changes: 2 additions & 2 deletions model-optimizer/mo/graph/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def set_source(self, port):
if self.control_flow is True:
raise Error("Cannot operate with connection with control_flow=True")

if self.graph.stage in ['front', None]:
if self.graph.stage == 'front':
scr_node = port.node
# Reconnecting all destinations as consumers to the source port preserving edge attrs
for dst_port in self.destinations:
Expand Down Expand Up @@ -204,7 +204,7 @@ def add_destination(self, port):
if self.source is None:
raise Error("Can not add destination for connection without source port!")

if self.graph.stage in ['front', None]:
if self.graph.stage == 'front':
node = self.source.node
self.graph.create_edge(node, port.node, out_port=self.source.idx, in_port=port.idx)
else:
Expand Down

0 comments on commit baf2b02

Please sign in to comment.