ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::ir::operation::Reduce Class Reference

#include <Reduce.h>

Collaboration diagram for onert::ir::operation::Reduce:

Data Structures

struct  Param
 

Public Types

enum  Input { INPUT = 0 , AXES = 1 }
 
enum class  ReduceType {
  ALL , ANY , MAX , MEAN ,
  MIN , PROD , SUM
}
 

Public Member Functions

 Reduce (const OperandIndexSequence &inputs, const OperandIndexSequence &outputs, const Param &param)
 
void accept (OperationVisitor &v) const override
 
std::string name () const override
 
OpCode opcode () const final
 
const Paramparam () const
 
- Public Member Functions inherited from onert::ir::Operation
 Operation (OperandConstraint input_constr, const OperandIndexSequence &inputs, const OperandIndexSequence &outputs, OperandConstraint output_constr=OperandConstraint::createAny())
 
 Operation (OperandConstraint input_constr, OperandConstraint output_constr=OperandConstraint::createAny())
 
 Operation (const Operation &)=default
 
 Operation (Operation &&)=default
 
Operationoperator= (const Operation &)=default
 
Operationoperator= (Operation &&)=default
 
virtual ~Operation ()
 
void replaceInputs (const OperandIndex &from, const OperandIndex &to) override
 
void replaceOutputs (const OperandIndex &from, const OperandIndex &to) override
 
OperandIndexSequencegetInputs ()
 
const OperandIndexSequencegetInputs () const override
 
const OperandIndexSequencegetOutputs () const override
 
void setInputs (const OperandIndexSequence &indexes)
 
void setOutputs (const OperandIndexSequence &indexes)
 
- Public Member Functions inherited from onert::ir::IOperation
virtual ~IOperation ()=default
 

Detailed Description

Definition at line 31 of file Reduce.h.

Member Enumeration Documentation

◆ Input

Enumerator
INPUT 
AXES 

Definition at line 34 of file Reduce.h.

◆ ReduceType

Constructor & Destructor Documentation

◆ Reduce()

onert::ir::operation::Reduce::Reduce ( const OperandIndexSequence inputs,
const OperandIndexSequence outputs,
const Param param 
)

Definition at line 31 of file Reduce.cc.

34{
35}
static OperandConstraint createExact(uint32_t exact)
const Param & param() const
Definition Reduce.h:67

Member Function Documentation

◆ accept()

void onert::ir::operation::Reduce::accept ( OperationVisitor v) const
overridevirtual

Implements onert::ir::IOperation.

Reimplemented in onert::ir::train::operation::Reduce.

Definition at line 29 of file Reduce.cc.

29{ v.visit(*this); }

◆ name()

std::string onert::ir::operation::Reduce::name ( ) const
overridevirtual

Reimplemented from onert::ir::IOperation.

Definition at line 37 of file Reduce.cc.

38{
40 static const std::unordered_map<ReduceType, std::string> name_map{
41 {ReduceType::ALL, std::string{toString(opcode())} + "All"},
42 {ReduceType::ANY, std::string{toString(opcode())} + "Any"},
43 {ReduceType::MAX, std::string{toString(opcode())} + "Max"},
44 {ReduceType::MEAN, std::string{toString(opcode())} + "Mean"},
45 {ReduceType::MIN, std::string{toString(opcode())} + "Min"},
46 {ReduceType::PROD, std::string{toString(opcode())} + "Prod"},
47 {ReduceType::SUM, std::string{toString(opcode())} + "SUM"}};
48 return name_map.at(_param.reduce_type);
49 // return std::string(toString(opcode())) + reduce_type_str_map.at(_param.reduce_type);
50}
OpCode opcode() const final
Definition Reduce.h:64
const char * toString(OpCode opcode)
Definition OpCode.cc:26

References ALL, ANY, MAX, MEAN, MIN, opcode(), PROD, onert::ir::operation::Reduce::Param::reduce_type, SUM, and onert::ir::toString().

Referenced by onert::exec::DynamicShapeInferer::visit().

◆ opcode()

OpCode onert::ir::operation::Reduce::opcode ( ) const
inlinefinalvirtual

Implements onert::ir::IOperation.

Definition at line 64 of file Reduce.h.

64{ return OpCode::Reduce; }

Referenced by name().

◆ param()

const Param & onert::ir::operation::Reduce::param ( ) const
inline

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