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]) -> NoneOne 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.
Properties
byte_size
python
byte_size: intGet the approximate memory used by this entry.
Returns:
int– The frame bytes held by this entry.
Methods
to_result
python
to_result(environment_id: int) -> MultiEnvResultSynthesize 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.
Values
data
python
data: dict[str, float]is_win
python
is_win: boolpadded_frames
python
padded_frames: np.ndarrayreward
python
reward: floatstack_size
python
stack_size: intsteps_taken
python
steps_taken: intterminated
python
terminated: booltruncated
python
truncated: bool