This will set boolean return type for ShapeInferenceSession to() method
Signed-off-by: SaeHie Park <saehie.park@samsung.com>
}
public:
- void to(Graph *g) const;
+ bool to(Graph *g) const;
private:
const ShapeInferenceRule *_rule;
namespace loco
{
-void ShapeInferenceSession::to(Graph *g) const
+bool ShapeInferenceSession::to(Graph *g) const
{
+ bool changed = false;
+
for (auto node : loco::postorder_traversal(loco::output_nodes(g)))
{
if (_rule->recognize(node->dialect()))
if (_rule->infer(node, shape))
{
node->annot(stdex::make_unique<ShapeAnnotation>(shape));
+ changed = true;
}
}
}
+
+ return changed;
}
bool ShapeInference::known(const Node *node) { return node->annot<ShapeAnnotation>() != nullptr; }