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

34 {
35 INPUT = 0,
47 INPUT_GATE_BIAS = 12,
49 CELL_BIAS = 14,
52 PROJECTION_BIAS = 17,
53 OUTPUT_STATE_IN = 18,
54 CELL_STATE_IN = 19,
59 };

◆ Output

Enumerator
SCRATCH_BUFFER 
OUTPUT_STATE_OUT 
CELL_STATE_OUT 
OUTPUT 

Definition at line 61 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 29 of file LSTM.cc.

31 : Operation{OperandConstraint::createInRange(20u, 24u), inputs, outputs}, _param{param}
32{
33}
static OperandConstraint createInRange(uint32_t begin, uint32_t end)
const Param & param() const
Definition LSTM.h:86

Member Function Documentation

◆ accept()

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

Implements onert::ir::IOperation.

Definition at line 27 of file LSTM.cc.

27{ v.visit(*this); }

◆ name()

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

Reimplemented from onert::ir::IOperation.

Definition at line 35 of file LSTM.cc.

36{
37 if (getOutputs().at(Output::SCRATCH_BUFFER).undefined())
38 return std::string{"UnidirectionalSequenceLSTM"};
39 else
40 return Operation::name();
41}
const OperandIndexSequence & getOutputs() const override
Definition Operation.h:55
virtual std::string name() const
Definition IOperation.h:38

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

83{ return OpCode::LSTM; }

◆ param()

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

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