Skip to content

CachedReplay ​

python
CachedReplay(padded_frames: np.ndarray, stack_size: int, steps_taken: int, reward: float, terminated: bool, truncated: bool, is_win: bool, data: dict[str, float]) -> None

One cached replay slice: everything needed to reproduce its MultiEnvResult without the emulator.

The frames are stored once in a padded array of shape (steps_taken+stack_size - 1, height, width) whose first stack_size rows are the first rolling stack; the rolling stack after step i is then the zero-copy slice padded_frames[i : i + stack_size], because each step's stack is the previous stack shifted forward one frame.

Source

Properties ​

byte_size ​

python
byte_size: int

Get the approximate memory used by this entry.

Returns:

  • int – The frame bytes held by this entry.

Source

Methods ​

to_result ​

python
to_result(environment_id: int) -> MultiEnvResult

Synthesize the replay result this slice would produce, identical to re-running the emulator.

Parameters:

  • environment_id (int) – The environment the replay was scheduled for.

Returns:

  • MultiEnvResult – The synthesized replay result.

Source

Values ​

data ​

python
data: dict[str, float]

Source

is_win ​

python
is_win: bool

Source

padded_frames ​

python
padded_frames: np.ndarray

Source

reward ​

python
reward: float

Source

stack_size ​

python
stack_size: int

Source

steps_taken ​

python
steps_taken: int

Source

terminated ​

python
terminated: bool

Source

truncated ​

python
truncated: bool

Source