brainevent.config.clear_backends#
- brainevent.config.clear_backends()[source]#
Clear all global backend defaults.
After calling this function, all primitives revert to their per-primitive defaults (set via
XLACustomKernel.set_defaultor registration order).See also
set_backendSet the global backend for a platform.
get_backendQuery the current global backend for a platform.
Notes
Like
set_backend(), this invalidates JAX’s lowering/compilation caches (viajax.clear_caches()) so that call sites already compiled under the old global backends pick up the reverted per-primitive defaults – but only when there was something to clear: if no global backend was set for any platform, this is a no-op and does not touch JAX’s caches. This is a setup-time, single-threaded control; seeset_backend()for the concurrency caveat.Examples
>>> import brainevent >>> brainevent.set_backend('gpu', 'warp') >>> brainevent.clear_backends() >>> brainevent.get_backend('gpu') is None True