This will introduce push_node implementation that retuns TFPush node with given GraphOutputIndex
Signed-off-by: SaeHie Park <saehie.park@samsung.com>
assert(_index <= std::numeric_limits<loco::GraphOutputIndex>::max());
return static_cast<loco::GraphOutputIndex>(_index);
}
+
+TFPush *push_node(loco::Graph *g, const loco::GraphOutputIndex &index)
+{
+ for (uint32_t n = 0; n < g->nodes()->size(); ++n)
+ {
+ if (auto tfpush = dynamic_cast<TFPush *>(g->nodes()->at(n)))
+ {
+ if (tfpush->indexed() && tfpush->index() == index)
+ {
+ return tfpush;
+ }
+ }
+ }
+ return nullptr;
+}
+
} // namespace moco