|
virtual int32_t | getLayerCount () const =0 |
|
virtual int32_t | getHiddenSize () const =0 |
|
virtual int32_t | getMaxSeqLength () const =0 |
|
virtual int32_t | getDataLength () const =0 |
|
virtual void | setSequenceLengths (ITensor &seqLengths)=0 |
| Specify individual sequence lengths in the batch with the ITensor pointed to by seqLengths . More...
|
|
virtual ITensor * | getSequenceLengths () const =0 |
| Get the sequence lengths specified for the RNN. More...
|
|
virtual void | setOperation (RNNOperation op)=0 |
| Set the operation of the RNN layer. More...
|
|
virtual RNNOperation | getOperation () const =0 |
| Get the operation of the RNN layer. More...
|
|
virtual void | setInputMode (RNNInputMode op)=0 |
| Set the input mode of the RNN layer. More...
|
|
virtual RNNInputMode | getInputMode () const =0 |
| Get the input mode of the RNN layer. More...
|
|
virtual void | setDirection (RNNDirection op)=0 |
| Set the direction of the RNN layer. More...
|
|
virtual RNNDirection | getDirection () const =0 |
| Get the direction of the RNN layer. More...
|
|
virtual void | setWeightsForGate (int layerIndex, RNNGateType gate, bool isW, Weights weights)=0 |
| Set the weight parameters for an individual gate in the RNN. More...
|
|
virtual Weights | getWeightsForGate (int layerIndex, RNNGateType gate, bool isW) const =0 |
| Get the weight parameters for an individual gate in the RNN. More...
|
|
virtual void | setBiasForGate (int layerIndex, RNNGateType gate, bool isW, Weights bias)=0 |
| Set the bias parameters for an individual gate in the RNN. More...
|
|
virtual Weights | getBiasForGate (int layerIndex, RNNGateType gate, bool isW) const =0 |
| Get the bias parameters for an individual gate in the RNN. More...
|
|
virtual void | setHiddenState (ITensor &hidden)=0 |
| Set the initial hidden state of the RNN with the provided hidden ITensor. More...
|
|
virtual ITensor * | getHiddenState () const =0 |
| Get the initial hidden state of the RNN. More...
|
|
virtual void | setCellState (ITensor &cell)=0 |
| Set the initial cell state of the LSTM with the provided cell ITensor. More...
|
|
virtual ITensor * | getCellState () const =0 |
| Get the initial cell state of the RNN. More...
|
|
virtual LayerType | getType () const =0 |
| Return the type of a layer. More...
|
|
virtual void | setName (const char *name)=0 |
| Set the name of a layer. More...
|
|
virtual const char * | getName () const =0 |
| Return the name of a layer. More...
|
|
virtual int | getNbInputs () const =0 |
| Get the number of inputs of a layer.
|
|
virtual ITensor * | getInput (int index) const =0 |
| Get the layer input corresponding to the given index. More...
|
|
virtual int | getNbOutputs () const =0 |
| Get the number of outputs of a layer.
|
|
virtual ITensor * | getOutput (int index) const =0 |
| Get the layer output corresponding to the given index. More...
|
|
An RNN layer in a network definition, version 2.
This layer supersedes IRNNLayer.
virtual void nvinfer1::IRNNv2Layer::setCellState |
( |
ITensor & |
cell | ) |
|
|
pure virtual |
Set the initial cell state of the LSTM with the provided cell
ITensor.
The cell
ITensor should have the dimensions {N1, ..., Np, L, H}
, where:
N1..Np
are the index dimensions specified by the input tensor
L
is the number of layers in the RNN, equal to getLayerCount()
H
is the hidden state for each layer, equal to getHiddenSize() if getDirection is kUNIDIRECTION, and 2x getHiddenSize() otherwise.
It is an error to call setCellState() on an RNN layer that is not configured with RNNOperation::kLSTM.
virtual void nvinfer1::IRNNv2Layer::setSequenceLengths |
( |
ITensor & |
seqLengths | ) |
|
|
pure virtual |
Specify individual sequence lengths in the batch with the ITensor pointed to by seqLengths
.
The seqLengths
ITensor should be a {N1, ..., Np} tensor, where N1..Np are the index dimensions of the input tensor to the RNN.
If this is not specified, then the RNN layer assumes all sequences are size getMaxSeqLength().
All sequence lengths in seqLengths
should be in the range [1, getMaxSeqLength()]. Zero-length sequences are not supported.
This tensor must be of type DataType::kINT32.