Skip to main content

check_backends

Function check_backends 

Source
pub fn check_backends<E: Environment>(
    env: &E,
    steps: usize,
    seed: i64,
    xla: Xla,
) -> Result<(), String>
where E::State<Native>: Send + Sync, E::Params<Native>: Send + Sync, E::Obs<Native>: Send + Sync, E::State<Trace>: Send + Sync, E::Obs<Trace>: Send + Sync,
Expand description

Runs steps steps of env with the same keys and actions natively, as IR with the interpreter, and optionally with XLA, comparing the results of every step.

The native backend and the interpreter share their kernels, so they must agree bit for bit; XLA must agree on integers and booleans and within a small tolerance on floats. Each step starts from the native state, so that differences in the last bits do not accumulate. Actions cycle through the action space with a pseudo-random pattern.

ยงErrors

Returns a description of the first difference.