qem.backend_utils
Backend detection and configuration utilities.
Functions
Auto-configure backend if none is set. |
|
|
Apply backend-specific configurations. |
|
Configure Keras to use the specified backend. |
Detect which Keras backends are available in the current environment. |
|
Get the best available backend for the current environment. |
|
Set up the best available backend for testing. |
- qem.backend_utils.detect_available_backends()[source]
Detect which Keras backends are available in the current environment.
- Returns:
list – List of available backend names in order of preference
- qem.backend_utils.get_best_backend()[source]
Get the best available backend for the current environment.
- Returns:
str – Name of the best available backend
- Raises:
RuntimeError – If no backends are available
- qem.backend_utils.configure_backend(backend_name=None, force=False)[source]
Configure Keras to use the specified backend.
- Parameters:
backend_name (
str, optional
) – Backend to use. If None, auto-detect best.force (
bool
) – Whether to force reconfiguration even if already set.
- Returns:
str – Name of the configured backend
- qem.backend_utils.setup_test_backend()[source]
Set up the best available backend for testing.
- Returns:
str – Name of the configured backend