Skip to content

FNNEStateBuffer

Buffer for storing recurrent neural network state across time steps.

This buffer maintains state information for sequence-based neural network models, storing a sequence of state vectors that can be shifted and updated.

struct FNNEStateBuffer

Methods

FNNEStateBuffer

FNNEStateBuffer() = default

FNNEStateBuffer

inline FNNEStateBuffer(TConstArrayView<int32> Shape, int InMaxSeqLen = 1)

Parameters

  • Shape (TConstArrayView<int32>)

  • InMaxSeqLen (int, default: 1)


Shift

inline void Shift()

Shifts the state sequence by removing the oldest state and making room for a new one.


HasSequenceDimension

inline bool HasSequenceDimension() const

Update

inline void Update()

Advances recurrent state (shifts sequence) when a sequence dimension exists.


MakeInputBinding

inline UE::NNE::FTensorBindingCPU MakeInputBinding() const

Creates an NNE tensor binding for the entire state buffer as input.


MakeOutputBinding

inline UE::NNE::FTensorBindingCPU MakeOutputBinding() const

Creates an NNE tensor binding for the last state vector as output.

Attributes

StateBuffer

TArray<float> StateBuffer

Buffer storing the sequence of state vectors.


Shape

TArray<int> Shape = TArray<int>()

Tensor shape for the state buffer (batch fixed to 1 where applicable).


MaxSeqLen

int MaxSeqLen = 0

Maximum Length of the state sequence.


SeqDim

int SeqDim = -1

Index of the sequence dimension in the shape (or -1 if no sequence dimension).


StateDimSize

int StateDimSize = 1

Flat size of one state vector (product of non-sequence dimensions).

Source: Source/ScholaNNE/Public/NNEUtils/NNEBuffer.h