ONE - On-device Neural Engine
|
#include <ShapeInferenceRule.h>
Data Structures | |
struct | Context |
struct | Sink |
Public Types | |
enum class | API { V1 , V2 } |
Public Member Functions | |
virtual | ~ShapeInferenceRule ()=default |
virtual bool | support (const API &api) const |
Check whether a given API is available or not. | |
virtual bool | recognize (const Dialect *) const =0 |
Return true if this rule recognizes a given dialect. | |
virtual bool | infer (const Node *, NodeShape &) const =0 |
Infer node's shape. | |
virtual void | infer (const Context *, const Node *, Sink *) const |
Definition at line 28 of file ShapeInferenceRule.h.
|
strong |
Enumerator | |
---|---|
V1 | API v1 This API uses "shape_get" method to query the shape of other nodes. |
V2 | API v2 This API uses a given context (defined below) to query the shape of other nodes. |
Definition at line 32 of file ShapeInferenceRule.h.
|
virtualdefault |
Reimplemented in moco::TFShapeInferenceRule, and loco::CanonicalShapeInferenceRule.
Definition at line 26 of file ShapeInferenceRule.cpp.
Infer node's shape.
WARNING!!
Implementation SHOULD return true only when it succeeds in inference!
Implemented in locoex::CircleShapeInferenceRule, locoex::TFLShapeInferenceRule, locoex::COpShapeInferenceRule, luci::CircleShapeInferenceRule, moco::TFShapeInferenceRule, loco::CanonicalShapeInferenceRule, and loco::MultiDialectShapeInferenceRule.
Referenced by loco::ShapeInferenceSession::to().
|
pure virtual |
Return true if this rule recognizes a given dialect.
Implemented in loco::CanonicalShapeInferenceRule, loco::MultiDialectShapeInferenceRule, locoex::CircleShapeInferenceRule, locoex::TFLShapeInferenceRule, locoex::COpShapeInferenceRule, luci::CircleShapeInferenceRule, and moco::TFShapeInferenceRule.
Referenced by loco::MultiDialectShapeInferenceRule::bind(), and loco::ShapeInferenceSession::to().
|
inlinevirtual |
Check whether a given API is available or not.
Reimplemented in loco::CanonicalShapeInferenceRule, and moco::TFShapeInferenceRule.
Definition at line 50 of file ShapeInferenceRule.h.
References V1.
Referenced by loco::ShapeInferenceSession::to().