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

encodes input sentences into output states using LSTM More...

Inheritance diagram for nmtSample::LSTMEncoder:
Collaboration diagram for nmtSample::LSTMEncoder:

Public Types

typedef std::shared_ptr< Encoderptr
 

Public Member Functions

 LSTMEncoder (ComponentWeights::ptr weights)
 
void addToModel (nvinfer1::INetworkDefinition *network, int maxInputSequenceLength, nvinfer1::ITensor *inputEmbeddedData, nvinfer1::ITensor *actualInputSequenceLengths, nvinfer1::ITensor **inputStates, nvinfer1::ITensor **memoryStates, nvinfer1::ITensor **lastTimestepStates) override
 add the memory and last timestep states to the network lastTimestepHiddenStates is the pointer to the tensor where the encoder stores all layer hidden states for the last timestep (which is dependent on the sample), the function should define the tensor, it could be nullptr indicating these data are not needed More...
 
int getMemoryStatesSize () override
 get the size of the memory state vector More...
 
std::vector< nvinfer1::DimsgetStateSizes () override
 get the sizes (vector of them) of the hidden state vectors More...
 
std::string getInfo () override
 get the textual description of the component More...
 
 ~LSTMEncoder () override=default
 

Protected Attributes

ComponentWeights::ptr mWeights
 
std::vector< nvinfer1::WeightsmGateKernelWeights
 
std::vector< nvinfer1::WeightsmGateBiasWeights
 
bool mRNNKind
 
int mNumLayers
 
int mNumUnits
 

Detailed Description

encodes input sentences into output states using LSTM

Member Typedef Documentation

◆ ptr

typedef std::shared_ptr<Encoder> nmtSample::Encoder::ptr
inherited

Constructor & Destructor Documentation

◆ LSTMEncoder()

nmtSample::LSTMEncoder::LSTMEncoder ( ComponentWeights::ptr  weights)
Here is the call graph for this function:

◆ ~LSTMEncoder()

nmtSample::LSTMEncoder::~LSTMEncoder ( )
overridedefault

Member Function Documentation

◆ addToModel()

void nmtSample::LSTMEncoder::addToModel ( nvinfer1::INetworkDefinition network,
int  maxInputSequenceLength,
nvinfer1::ITensor inputEmbeddedData,
nvinfer1::ITensor actualInputSequenceLengths,
nvinfer1::ITensor **  inputStates,
nvinfer1::ITensor **  memoryStates,
nvinfer1::ITensor **  lastTimestepStates 
)
overridevirtual

add the memory and last timestep states to the network lastTimestepHiddenStates is the pointer to the tensor where the encoder stores all layer hidden states for the last timestep (which is dependent on the sample), the function should define the tensor, it could be nullptr indicating these data are not needed

Implements nmtSample::Encoder.

◆ getMemoryStatesSize()

int nmtSample::LSTMEncoder::getMemoryStatesSize ( )
overridevirtual

get the size of the memory state vector

Implements nmtSample::Encoder.

◆ getStateSizes()

std::vector< nvinfer1::Dims > nmtSample::LSTMEncoder::getStateSizes ( )
overridevirtual

get the sizes (vector of them) of the hidden state vectors

Implements nmtSample::Encoder.

◆ getInfo()

std::string nmtSample::LSTMEncoder::getInfo ( )
overridevirtual

get the textual description of the component

Implements nmtSample::Component.

Member Data Documentation

◆ mWeights

ComponentWeights::ptr nmtSample::LSTMEncoder::mWeights
protected

◆ mGateKernelWeights

std::vector<nvinfer1::Weights> nmtSample::LSTMEncoder::mGateKernelWeights
protected

◆ mGateBiasWeights

std::vector<nvinfer1::Weights> nmtSample::LSTMEncoder::mGateBiasWeights
protected

◆ mRNNKind

bool nmtSample::LSTMEncoder::mRNNKind
protected

◆ mNumLayers

int nmtSample::LSTMEncoder::mNumLayers
protected

◆ mNumUnits

int nmtSample::LSTMEncoder::mNumUnits
protected

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