ONE - On-device Neural Engine
Loading...
Searching...
No Matches
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 29 of file ElementwiseUnary.h.

Member Enumeration Documentation

◆ Input

Enumerator
INPUT 

Definition at line 32 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 31 of file ElementwiseUnary.cc.

35 _param{param}
36{
37}
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 29 of file ElementwiseUnary.cc.

29{ v.visit(*this); }

◆ name()

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

Reimplemented from onert::ir::IOperation.

Definition at line 39 of file ElementwiseUnary.cc.

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

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

◆ opcode()

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

Implements onert::ir::IOperation.

Definition at line 70 of file ElementwiseUnary.h.

70{ return OpCode::ElementwiseUnary; }

◆ param()

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

Definition at line 73 of file ElementwiseUnary.h.

73{ 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: