TransitionAccumulator
python
TransitionAccumulator(batch_add_size: int) -> NoneBuffers emitted n-step transitions and emits replay-ready batches.
Initialize the transition accumulator.
Parameters:
batch_add_size(int) – Number of staged transitions required before automatic flush.
Properties
buffered_count
python
buffered_count: intGet the number of transitions currently staged.
Returns:
int– The number of buffered transitions.
Methods
extend
python
extend(transitions: Iterable[BufferedTransition]) -> ReplayBatch | NoneStage transitions and emit a replay batch once the configured batch size is reached.
Parameters:
transitions(Iterable[BufferedTransition]) – Transitions emitted from one or more n-step buffers.
Returns:
ReplayBatch | None– A replay batch when the local buffer reaches the configured size, otherwiseNone.
flush
python
flush() -> ReplayBatch | NoneFlush all staged transitions into one replay batch.
Returns:
ReplayBatch | None– A replay batch containing all staged transitions, orNoneif the buffer is empty.