jax.execution_options

jax.execution_options#

jax.execution_options(*, custom_options=None)[source]#

Context manager that sets per-execution options for the runtime.

Every computation dispatched from the current thread within this context runs with the given execution options. Execution options are not part of the compiled program and can be different for every call of the same compiled function. Nested contexts are merged, innermost wins.

Parameters:

custom_options (Mapping[str, CustomOptionValue] | None) – runtime-defined key/value options, forwarded to the runtime as ifrt::ExecuteOptions::custom_options. Supported value types are bool, int (forwarded as a 64-bit integer), float (forwarded as a 32-bit float), str and sequences of int.

Return type:

Iterator[None]