@Namespace(value="nvinfer1") @NoOffset @Properties(inherit=nvinfer.class) public class IRNNv2Layer extends ILayer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
IRNNv2Layer(Pointer p)
Deprecated.
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
Weights |
getBiasForGate(int layerIndex,
int gate,
boolean isW)
Deprecated.
|
Weights |
getBiasForGate(int layerIndex,
nvinfer.RNNGateType gate,
boolean isW)
Deprecated.
\brief Get the bias parameters for an individual gate in the RNN.
|
ITensor |
getCellState()
Deprecated.
\brief Get the initial cell state of the RNN.
|
int |
getDataLength()
Deprecated.
Get the embedding length of the RNN.
|
nvinfer.RNNDirection |
getDirection()
Deprecated.
\brief Get the direction of the RNN layer.
|
int |
getHiddenSize()
Deprecated.
Get the hidden size of the RNN.
|
ITensor |
getHiddenState()
Deprecated.
\brief Get the initial hidden state of the RNN.
|
nvinfer.RNNInputMode |
getInputMode()
Deprecated.
\brief Get the input mode of the RNN layer.
|
int |
getLayerCount()
Deprecated.
Get the layer count of the RNN.
|
int |
getMaxSeqLength()
Deprecated.
Get the maximum sequence length of the RNN.
|
nvinfer.RNNOperation |
getOperation()
Deprecated.
\brief Get the operation of the RNN layer.
|
ITensor |
getSequenceLengths()
Deprecated.
\brief Get the sequence lengths specified for the RNN.
|
Weights |
getWeightsForGate(int layerIndex,
int gate,
boolean isW)
Deprecated.
|
Weights |
getWeightsForGate(int layerIndex,
nvinfer.RNNGateType gate,
boolean isW)
Deprecated.
\brief Get the weight parameters for an individual gate in the RNN.
|
void |
setBiasForGate(int layerIndex,
int gate,
boolean isW,
Weights bias)
Deprecated.
|
void |
setBiasForGate(int layerIndex,
nvinfer.RNNGateType gate,
boolean isW,
Weights bias)
Deprecated.
\brief Set the bias parameters for an individual gate in the RNN.
|
void |
setCellState(ITensor cell)
Deprecated.
\brief Set the initial cell state of the LSTM with the provided \p cell ITensor.
|
void |
setDirection(int op)
Deprecated.
|
void |
setDirection(nvinfer.RNNDirection op)
Deprecated.
\brief Set the direction of the RNN layer.
|
void |
setHiddenState(ITensor hidden)
Deprecated.
\brief Set the initial hidden state of the RNN with the provided \p hidden ITensor.
|
void |
setInputMode(int op)
Deprecated.
|
void |
setInputMode(nvinfer.RNNInputMode op)
Deprecated.
\brief Set the input mode of the RNN layer.
|
void |
setOperation(int op)
Deprecated.
|
void |
setOperation(nvinfer.RNNOperation op)
Deprecated.
\brief Set the operation of the RNN layer.
|
void |
setSequenceLengths(ITensor seqLengths)
Deprecated.
\brief Specify individual sequence lengths in the batch with the ITensor pointed to by
\p seqLengths.
|
void |
setWeightsForGate(int layerIndex,
int gate,
boolean isW,
Weights weights)
Deprecated.
|
void |
setWeightsForGate(int layerIndex,
nvinfer.RNNGateType gate,
boolean isW,
Weights weights)
Deprecated.
\brief Set the weight parameters for an individual gate in the RNN.
|
getInput, getMetadata, getName, getNbInputs, getNbOutputs, getOutput, getOutputType, getPrecision, getType, outputTypeIsSet, precisionIsSet, resetOutputType, resetPrecision, setInput, setMetadata, setMetadata, setName, setName, setOutputType, setOutputType, setPrecision, setPrecision
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public IRNNv2Layer(Pointer p)
Pointer(Pointer)
.@NoException(value=true) public int getLayerCount()
@NoException(value=true) public int getHiddenSize()
@NoException(value=true) public int getMaxSeqLength()
@NoException(value=true) public int getDataLength()
//! //! //! //! //! //!
@NoException(value=true) public void setSequenceLengths(@ByRef ITensor seqLengths)
@NoException(value=true) public ITensor getSequenceLengths()
setSequenceLengths()
@NoException(value=true) public void setOperation(nvinfer.RNNOperation op)
getOperation(), RNNOperation
@NoException(value=true) public void setOperation(@Cast(value="nvinfer1::RNNOperation") int op)
@NoException(value=true) public nvinfer.RNNOperation getOperation()
setOperation(), RNNOperation
@NoException(value=true) public void setInputMode(nvinfer.RNNInputMode op)
getInputMode(), RNNInputMode
@NoException(value=true) public void setInputMode(@Cast(value="nvinfer1::RNNInputMode") int op)
@NoException(value=true) public nvinfer.RNNInputMode getInputMode()
setInputMode(), RNNInputMode
@NoException(value=true) public void setDirection(nvinfer.RNNDirection op)
getDirection(), RNNDirection
@NoException(value=true) public void setDirection(@Cast(value="nvinfer1::RNNDirection") int op)
@NoException(value=true) public nvinfer.RNNDirection getDirection()
setDirection(), RNNDirection
@NoException(value=true) public void setWeightsForGate(int layerIndex, nvinfer.RNNGateType gate, @Cast(value="bool") boolean isW, @ByVal Weights weights)
getDataLength()
-size column
vector into a getHiddenSize()
-size column vector. The input
weights of subsequent layers transform a K*getHiddenSize()
-size
column vector into a getHiddenSize()
-size column vector. K=2
in
the bidirectional case to account for the full hidden state being
the concatenation of the forward and backward RNN hidden states.
The recurrent weight matrices for all layers all have shape (H, H)
,
both in the unidirectional and bidirectional cases. (In the
bidirectional case, each recurrent weight matrix for the (forward or
backward) RNN cell operates on the previous (forward or
backward) RNN cell's hidden state, which is size H
).layerIndex
- The index of the layer that contains this gate.gate
- The name of the gate within the RNN layer. The gate name must correspond
to one of the gates used by this layer's #RNNOperation.isW
- True if the weight parameters are for the input matrix W[g]
and false if they are for the recurrent input matrix R[g]. See
#RNNOperation for equations showing how these matrices are used
in the RNN gate.weights
- The weight structure holding the weight parameters, which are stored
as a row-major 2D matrix. See See \ref setWeightsForGate() for documentation on the expected
dimensions of this matrix.@NoException(value=true) public void setWeightsForGate(int layerIndex, @Cast(value="nvinfer1::RNNGateType") int gate, @Cast(value="bool") boolean isW, @ByVal Weights weights)
@ByVal @NoException(value=true) public Weights getWeightsForGate(int layerIndex, nvinfer.RNNGateType gate, @Cast(value="bool") boolean isW)
setWeightsForGate()
@ByVal @NoException(value=true) public Weights getWeightsForGate(int layerIndex, @Cast(value="nvinfer1::RNNGateType") int gate, @Cast(value="bool") boolean isW)
@NoException(value=true) public void setBiasForGate(int layerIndex, nvinfer.RNNGateType gate, @Cast(value="bool") boolean isW, @ByVal Weights bias)
layerIndex
- The index of the layer that contains this gate. See \ref setWeightsForGate()
for a description of the layer index.gate
- The name of the gate within the RNN layer. The gate name must correspond
to one of the gates used by this layer's #RNNOperation.isW
- True if the bias parameters are for the input bias Wb[g]
and false if they are for the recurrent input bias Rb[g]. See
#RNNOperation for equations showing how these bias vectors are used
in the RNN gate.bias
- The weight structure holding the bias parameters, which should be an
array of size getHiddenSize().@NoException(value=true) public void setBiasForGate(int layerIndex, @Cast(value="nvinfer1::RNNGateType") int gate, @Cast(value="bool") boolean isW, @ByVal Weights bias)
@ByVal @NoException(value=true) public Weights getBiasForGate(int layerIndex, nvinfer.RNNGateType gate, @Cast(value="bool") boolean isW)
setBiasForGate()
@ByVal @NoException(value=true) public Weights getBiasForGate(int layerIndex, @Cast(value="nvinfer1::RNNGateType") int gate, @Cast(value="bool") boolean isW)
@NoException(value=true) public void setHiddenState(@ByRef ITensor hidden)
{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() if getDirection is
RNNDirection::kUNIDIRECTION,
and 2x getLayerCount() if getDirection is RNNDirection::kBIDIRECTION. In the bi-directional
case, layer l
's final forward hidden state is stored in L = 2*l
, and
final backward hidden state is stored in L= 2*l + 1
.
- H
is the hidden state for each layer, equal to getHiddenSize().@NoException(value=true) public ITensor getHiddenState()
setHiddenState()
@NoException(value=true) public void setCellState(@ByRef ITensor cell)
{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() if getDirection is
RNNDirection::kUNIDIRECTION,
and 2x getLayerCount() if getDirection is RNNDirection::kBIDIRECTION. In the bi-directional
case, layer l
's final forward hidden state is stored in L = 2*l
, and
final backward hidden state is stored in L= 2*l + 1
.
- H
is the hidden state for each layer, equal to getHiddenSize().
It is an error to call setCellState() on an RNN layer that is not configured with RNNOperation::kLSTM.@NoException(value=true) public ITensor getCellState()
setCellState()
Copyright © 2024. All rights reserved.