ONE - On-device Neural Engine
Loading...
Searching...
No Matches
exo::TensorReduceConverter Class Reference

Convert loco::TensorReduce to appropriate TFL reduce operation. More...

#include <TensorReduceConverter.h>

Collaboration diagram for exo::TensorReduceConverter:

Public Member Functions

const char * name (void) const final
 
bool convert (loco::TensorReduce *origin) final
 
- Public Member Functions inherited from exo::CanonicalNodeConverter< loco::TensorReduce >
bool run (loco::Graph *graph)
 Run the pass.
 
- Public Member Functions inherited from logo::Pass
virtual ~Pass ()=default
 

Additional Inherited Members

Detailed Description

Convert loco::TensorReduce to appropriate TFL reduce operation.

Note
loco::TensorReduce always keep dimensions

Currently support:

  • When loco::TensorReduce::func() == Mean, convert to TFLMean + TFLConst
  • TODO Support other cases

Definition at line 35 of file TensorReduceConverter.h.

Member Function Documentation

◆ convert()

bool exo::TensorReduceConverter::convert ( loco::TensorReduce origin)
finalvirtual

Implements exo::CanonicalNodeConverter< loco::TensorReduce >.

Definition at line 87 of file TensorReduceConverter.cpp.

88{
89 if (origin->func() == loco::ReduceFunc::Mean)
90 return convert_as_mean(origin);
91 else
92 INTERNAL_EXN_V("Unsupported ReduceFunc", oops::to_uint32(origin->func()));
93}
#define INTERNAL_EXN_V(msg, val)
@ brief throw internal exception with message and value
Definition InternalExn.h:28
ReduceFunc func(void) const
Definition Nodes.h:630
uint32_t to_uint32(T a)
Definition InternalExn.h:33

References loco::TensorReduce::func(), INTERNAL_EXN_V, loco::Mean, and oops::to_uint32().

◆ name()

const char * exo::TensorReduceConverter::name ( void  ) const
inlinefinalvirtual

Reimplemented from exo::CanonicalNodeConverter< loco::TensorReduce >.

Definition at line 38 of file TensorReduceConverter.h.

38{ return "exo::TensorReduceConverter"; }

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