Skip to main content

Module testing

Module testing 

Source
Expand description

Tools for testing environments: agreement of the native backend, the interpreter, and XLA, and of vmap with native loops.

Enums§

Xla
Where check_backends runs the traced environment besides the interpreter.

Functions§

check_backends
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.
check_vmap
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.
trees_equal
Returns whether two pytrees of native values are equal bit for bit.