Both "link" helpers now update the index of a corresponding node.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
return static_cast<GraphOutputIndex>(_index);
}
-void link(GraphOutput *output, Push *push) { output->node(push); }
+void link(GraphOutput *output, Push *push)
+{
+ output->node(push);
+ push->index(output->index());
+}
} // namespace loco
}
}
-void link(GraphInput *input, Pull *pull) { input->node(pull); }
+void link(GraphInput *input, Pull *pull)
+{
+ input->node(pull);
+ pull->index(input->index());
+}
} // namespace loco
graph_output->name("output");
loco::link(graph_output, push_node);
- // Set Input Index
- pull_node->index(0);
-
+ // loco::link SHOULD update "index"
ASSERT_EQ(pull_node->index(), 0);
ASSERT_EQ(graph_input->dtype(), loco::DataType::FLOAT32);
- // Set Output Index
- push_node->index(0);
-
+ // loco::link SHOULD update "index"
ASSERT_EQ(push_node->index(), 0);
}