ONE - On-device Neural Engine
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
onert::ir::operation::ElementwiseUnary Class Reference

#include <ElementwiseUnary.h>

Collaboration diagram for onert::ir::operation::ElementwiseUnary:

Data Structures

struct  Param
 

Public Types

enum  Input { INPUT = 0 }
 
enum class  Type {
  ABS , CAST , COS , DEQUANTIZE ,
  ERF , EXP , FLOOR , LOG ,
  LOGICAL_NOT , NEG , QUANTIZE , ROUND ,
  RSQRT , SIN , SQRT , SQUARE ,
  ZEROS_LIKE
}
 

Public Member Functions

 ElementwiseUnary (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 25 of file ElementwiseUnary.h.

Member Enumeration Documentation

◆ Input

Enumerator
INPUT 

Definition at line 28 of file ElementwiseUnary.h.

◆ Type

Constructor & Destructor Documentation

◆ ElementwiseUnary()

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

Definition at line 27 of file ElementwiseUnary.cc.

31 _param{param}
32{
33}
static OperandConstraint createExact(uint32_t exact)

Member Function Documentation

◆ accept()

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

Implements onert::ir::IOperation.

Definition at line 25 of file ElementwiseUnary.cc.

25{ v.visit(*this); }

◆ name()

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

Reimplemented from onert::ir::IOperation.

Definition at line 35 of file ElementwiseUnary.cc.

36{
38 static const std::unordered_map<ElementwiseUnaryType, std::string> name_map{
39 {ElementwiseUnaryType::ABS, std::string{"Abs"}},
40 {ElementwiseUnaryType::CAST, std::string{"Cast"}},
41 {ElementwiseUnaryType::COS, std::string{"Cos"}},
42 {ElementwiseUnaryType::DEQUANTIZE, std::string{"Dequantize"}},
43 {ElementwiseUnaryType::ERF, std::string{"Erf"}},
44 {ElementwiseUnaryType::EXP, std::string{"Exp"}},
45 {ElementwiseUnaryType::FLOOR, std::string{"Floor"}},
46 {ElementwiseUnaryType::LOG, std::string{"Log"}},
47 {ElementwiseUnaryType::LOGICAL_NOT, std::string{"LogicalNot"}},
48 {ElementwiseUnaryType::NEG, std::string{"Neg"}},
49 {ElementwiseUnaryType::QUANTIZE, std::string{"Quantize"}},
50 {ElementwiseUnaryType::ROUND, std::string{"Round"}},
51 {ElementwiseUnaryType::RSQRT, std::string{"RSqrt"}},
52 {ElementwiseUnaryType::SIN, std::string{"Sin"}},
53 {ElementwiseUnaryType::SQRT, std::string{"Sqrt"}},
54 {ElementwiseUnaryType::SQUARE, std::string{"Square"}},
55 {ElementwiseUnaryType::ZEROS_LIKE, std::string{"ZerosLike"}}};
56 return name_map.at(_param.op_type);
57}

References onert::ir::operation::ElementwiseUnary::Param::op_type.

◆ opcode()

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

Implements onert::ir::IOperation.

Definition at line 66 of file ElementwiseUnary.h.

66{ return OpCode::ElementwiseUnary; }

◆ param()

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

Definition at line 69 of file ElementwiseUnary.h.

69{ return _param; }

Referenced by onert::backend::cpu::KernelGenerator::visit(), and onert::ir::OperationValidator::visit().


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