ONE - On-device Neural Engine
Loading...
Searching...
No Matches
moco::tf::ShapeInferencePass Class Reference

Run shape inference to the graph. More...

#include <ShapeInferencePass.h>

Collaboration diagram for moco::tf::ShapeInferencePass:

Public Member Functions

const char * name (void) const final
 
bool run (loco::Graph *graph) override
 Run the pass.
 
- Public Member Functions inherited from logo::Pass
virtual ~Pass ()=default
 

Detailed Description

Run shape inference to the graph.

Definition at line 32 of file ShapeInferencePass.h.

Member Function Documentation

◆ name()

const char * moco::tf::ShapeInferencePass::name ( void  ) const
inlinefinalvirtual

Reimplemented from logo::Pass.

Definition at line 35 of file ShapeInferencePass.h.

35{ return "ShapeInferencePass"; }

◆ run()

bool moco::tf::ShapeInferencePass::run ( loco::Graph graph)
overridevirtual

Run the pass.

Returns
false if there was nothing changed

Implements logo::Pass.

Definition at line 40 of file ShapeInferencePass.cpp.

41{
44 locoex::COpShapeInferenceRule cop_rule; // rule for custop op
45
47
48 rules.bind(loco::CanonicalDialect::get(), &canonical_rule)
49 .bind(TFDialect::get(), &tf_rule)
50 .bind(locoex::COpDialect::get(), &cop_rule);
51
52 return loco::apply(&rules).to(graph);
53}
static Dialect * get(void)
Shape inference rule for multiple dialects.
MultiDialectShapeInferenceRule & bind(const Dialect *d, const ShapeInferenceRule *rule)
Bind a specific rule to a Dialect.
static loco::Dialect * get(void)
static loco::Dialect * get(void)
Definition TFDialect.cpp:84
ShapeInferenceSession apply(ShapeInferenceRule *r)
Shape inference rule for canonical dialect.
Shape inference rule for COpDialect.
Shape inference rule for TensorFlow dialect.

References loco::apply(), loco::MultiDialectShapeInferenceRule::bind(), loco::CanonicalDialect::get(), locoex::COpDialect::get(), moco::TFDialect::get(), and loco::ShapeInferenceSession::to().

Referenced by package.infer.session::inference().


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