ONE - On-device Neural Engine
Loading...
Searching...
No Matches
locoex::CircleShapeInferenceRule Struct Referencefinal

#include <CircleShapeInferenceRule.h>

Collaboration diagram for locoex::CircleShapeInferenceRule:

Public Member Functions

bool recognize (const loco::Dialect *) const final
 Return true if this rule recognizes a given dialect.
 
bool infer (const loco::Node *, loco::NodeShape &) const final
 Infer node's shape.
 
- Public Member Functions inherited from loco::ShapeInferenceRule
virtual ~ShapeInferenceRule ()=default
 
virtual bool support (const API &api) const
 Check whether a given API is available or not.
 
virtual void infer (const Context *, const Node *, Sink *) const
 

Additional Inherited Members

- Public Types inherited from loco::ShapeInferenceRule
enum class  API { V1 , V2 }
 

Detailed Description

Definition at line 25 of file CircleShapeInferenceRule.h.

Member Function Documentation

◆ infer()

bool locoex::CircleShapeInferenceRule::infer ( const loco::Node ,
loco::NodeShape  
) const
finalvirtual

Infer node's shape.

WARNING!!

Implementation SHOULD return true only when it succeeds in inference!

Implements loco::ShapeInferenceRule.

Definition at line 56 of file CircleShapeInferenceRule.cpp.

57{
58 assert(node->dialect() == CircleDialect::get());
59 assert(dynamic_cast<const CircleNode *>(node) != nullptr);
60
61 ShapeInferenceAlgorithm alg;
62 shape = dynamic_cast<const CircleNode *>(node)->accept(&alg);
63
64 return true;
65}
static loco::Dialect * get(void)

References loco::Node::dialect(), and locoex::CircleDialect::get().

◆ recognize()

bool locoex::CircleShapeInferenceRule::recognize ( const loco::Dialect ) const
finalvirtual

Return true if this rule recognizes a given dialect.

Implements loco::ShapeInferenceRule.

Definition at line 51 of file CircleShapeInferenceRule.cpp.

52{
53 return CircleDialect::get() == d;
54}

References locoex::CircleDialect::get().


The documentation for this struct was generated from the following files: