Skip to content
Snippets Groups Projects
Commit bfd42761 authored by Tobi-Alonso's avatar Tobi-Alonso
Browse files

[Transform] Add checks to collapse repeated transform to work only on linear...

[Transform] Add checks to collapse repeated transform to work only on linear segments of graphs with branches
parent 440b6723
No related branches found
No related tags found
No related merge requests found
......@@ -48,9 +48,17 @@ class CollapseRepeatedOp(Transformation):
graph_modified = False
for n in graph.node:
node_ind += 1
if n.op_type == self.op_name:
if (
n.op_type == self.op_name
and not model.is_fork_node(n)
and not model.is_join_node(n)
):
consumer = model.find_consumer(n.output[0])
if consumer is not None and consumer.op_type == self.op_name:
if (
consumer is not None
and consumer.op_type == self.op_name
and not model.is_join_node(consumer)
):
op0_param_name = n.input[1]
op1_param_name = consumer.input[1]
op0_param = model.get_initializer(op0_param_name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment