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

#include <LSTM.h>

Collaboration diagram for onert::ir::operation::LSTM:

Data Structures

struct  Param
 

Public Types

enum  Input {
  INPUT = 0 , INPUT_TO_INPUT_WEIGHTS = 1 , INPUT_TO_FORGET_WEIGHTS = 2 , INPUT_TO_CELL_WEIGHTS = 3 ,
  INPUT_TO_OUTPUT_WEIGHTS = 4 , RECURRENT_TO_INPUT_WEIGHTS = 5 , RECURRENT_TO_FORGET_WEIGHTS = 6 , RECURRENT_TO_CELL_WEIGHTS = 7 ,
  RECURRENT_TO_OUTPUT_WEIGHTS = 8 , CELL_TO_INPUT_WEIGHTS = 9 , CELL_TO_FORGET_WEIGHTS = 10 , CELL_TO_OUTPUT_WEIGHTS = 11 ,
  INPUT_GATE_BIAS = 12 , FORGET_GATE_BIAS = 13 , CELL_BIAS = 14 , OUTPUT_GATE_BIAS = 15 ,
  PROJECTION_WEIGHTS = 16 , PROJECTION_BIAS = 17 , OUTPUT_STATE_IN = 18 , CELL_STATE_IN = 19 ,
  INPUT_LAYER_NORMALIZATION_WEIGHTS = 20 , FORGET_LAYER_NORMALIZATION_WEIGHTS = 21 , CELL_LAYER_NORMALIZATION_WEIGHTS = 22 , OUTPUT_LAYER_NORMALIZATION_WEIGHTS = 23
}
 
enum  Output { SCRATCH_BUFFER = 0 , OUTPUT_STATE_OUT = 1 , CELL_STATE_OUT = 2 , OUTPUT = 3 }
 

Public Member Functions

 LSTM (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 26 of file LSTM.h.

Member Enumeration Documentation

◆ Input

Enumerator
INPUT 
INPUT_TO_INPUT_WEIGHTS 
INPUT_TO_FORGET_WEIGHTS 
INPUT_TO_CELL_WEIGHTS 
INPUT_TO_OUTPUT_WEIGHTS 
RECURRENT_TO_INPUT_WEIGHTS 
RECURRENT_TO_FORGET_WEIGHTS 
RECURRENT_TO_CELL_WEIGHTS 
RECURRENT_TO_OUTPUT_WEIGHTS 
CELL_TO_INPUT_WEIGHTS 
CELL_TO_FORGET_WEIGHTS 
CELL_TO_OUTPUT_WEIGHTS 
INPUT_GATE_BIAS 
FORGET_GATE_BIAS 
CELL_BIAS 
OUTPUT_GATE_BIAS 
PROJECTION_WEIGHTS 
PROJECTION_BIAS 
OUTPUT_STATE_IN 
CELL_STATE_IN 
INPUT_LAYER_NORMALIZATION_WEIGHTS 
FORGET_LAYER_NORMALIZATION_WEIGHTS 
CELL_LAYER_NORMALIZATION_WEIGHTS 
OUTPUT_LAYER_NORMALIZATION_WEIGHTS 

Definition at line 29 of file LSTM.h.

30 {
31 INPUT = 0,
43 INPUT_GATE_BIAS = 12,
45 CELL_BIAS = 14,
48 PROJECTION_BIAS = 17,
49 OUTPUT_STATE_IN = 18,
50 CELL_STATE_IN = 19,
55 };

◆ Output

Enumerator
SCRATCH_BUFFER 
OUTPUT_STATE_OUT 
CELL_STATE_OUT 
OUTPUT 

Definition at line 57 of file LSTM.h.

Constructor & Destructor Documentation

◆ LSTM()

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

Definition at line 25 of file LSTM.cc.

27 : Operation{OperandConstraint::createInRange(20u, 24u), inputs, outputs}, _param{param}
28{
29}
static OperandConstraint createInRange(uint32_t begin, uint32_t end)
const Param & param() const
Definition LSTM.h:82

Member Function Documentation

◆ accept()

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

Implements onert::ir::IOperation.

Definition at line 23 of file LSTM.cc.

23{ v.visit(*this); }

◆ name()

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

Reimplemented from onert::ir::IOperation.

Definition at line 31 of file LSTM.cc.

32{
33 if (getOutputs().at(Output::SCRATCH_BUFFER).undefined())
34 return std::string{"UnidirectionalSequenceLSTM"};
35 else
36 return Operation::name();
37}
const OperandIndexSequence & getOutputs() const override
Definition Operation.h:53
virtual std::string name() const
Definition IOperation.h:36

References onert::ir::Operation::getOutputs(), onert::ir::IOperation::name(), and SCRATCH_BUFFER.

Referenced by onert::ir::OperationDumper::visit().

◆ opcode()

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

Implements onert::ir::IOperation.

Definition at line 79 of file LSTM.h.

79{ return OpCode::LSTM; }

◆ param()

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

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