TensorRT  7.2.1.6
NVIDIA TensorRT
Looking for a C++ dev who knows TensorRT?
I'm looking for work. Hire me!
nmtSample::Alignment Class Referenceabstract

represents the core of attention mechanism More...

Inheritance diagram for nmtSample::Alignment:
Collaboration diagram for nmtSample::Alignment:

Public Types

typedef std::shared_ptr< Alignmentptr
 

Public Member Functions

 Alignment ()=default
 
virtual void addToModel (nvinfer1::INetworkDefinition *network, nvinfer1::ITensor *attentionKeys, nvinfer1::ITensor *queryStates, nvinfer1::ITensor **alignmentScores)=0
 add the alignment scores calculation to the network More...
 
virtual void addAttentionKeys (nvinfer1::INetworkDefinition *network, nvinfer1::ITensor *memoryStates, nvinfer1::ITensor **attentionKeys)=0
 add attention keys calculation (from source memory states) to the network More...
 
virtual int getSourceStatesSize ()=0
 get the size of the source states More...
 
virtual int getAttentionKeySize ()=0
 get the size of the attention keys More...
 
 ~Alignment () override=default
 
virtual std::string getInfo ()=0
 get the textual description of the component More...
 

Detailed Description

represents the core of attention mechanism

Member Typedef Documentation

◆ ptr

typedef std::shared_ptr<Alignment> nmtSample::Alignment::ptr

Constructor & Destructor Documentation

◆ Alignment()

nmtSample::Alignment::Alignment ( )
default

◆ ~Alignment()

nmtSample::Alignment::~Alignment ( )
overridedefault

Member Function Documentation

◆ addToModel()

virtual void nmtSample::Alignment::addToModel ( nvinfer1::INetworkDefinition network,
nvinfer1::ITensor attentionKeys,
nvinfer1::ITensor queryStates,
nvinfer1::ITensor **  alignmentScores 
)
pure virtual

add the alignment scores calculation to the network

Implemented in nmtSample::MultiplicativeAlignment.

◆ addAttentionKeys()

virtual void nmtSample::Alignment::addAttentionKeys ( nvinfer1::INetworkDefinition network,
nvinfer1::ITensor memoryStates,
nvinfer1::ITensor **  attentionKeys 
)
pure virtual

add attention keys calculation (from source memory states) to the network

The funtion is called if getAttentionKeySize returns positive value

Implemented in nmtSample::MultiplicativeAlignment.

◆ getSourceStatesSize()

virtual int nmtSample::Alignment::getSourceStatesSize ( )
pure virtual

get the size of the source states

Implemented in nmtSample::MultiplicativeAlignment.

◆ getAttentionKeySize()

virtual int nmtSample::Alignment::getAttentionKeySize ( )
pure virtual

get the size of the attention keys

Implemented in nmtSample::MultiplicativeAlignment.

◆ getInfo()


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