Skip to main content

check_vmap

Function check_vmap 

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

Checks that the batched IR of reset and step (ruxla’s vmap, which JAX’s vmap uses) gives the same results as running each of n environments natively: bit for bit with the interpreter, and within a small tolerance with XLA.

The environments start from different keys and take different actions for steps steps, so that some episodes end and reset.

§Errors

Returns a description of the first difference.