duo_ai.utils.global_variables¶
Attributes¶
Functions¶
|
Set a global variable by key. |
|
Retrieve the value of a global variable by key. |
Get the dictionary of all global variables. |
Module Contents¶
- duo_ai.utils.global_variables.GLOBAL_VARIABLES¶
- duo_ai.utils.global_variables.set_global_variable(key, value)[source]¶
Set a global variable by key.
- Parameters:
key (str) – The key for the global variable.
value (Any) – The value to set for the global variable.
- Return type:
None
Examples
>>> set_global_variable('device', 'cuda')
- duo_ai.utils.global_variables.get_global_variable(key)[source]¶
Retrieve the value of a global variable by key.
- Parameters:
key (str) – The key for the global variable.
- Returns:
The value of the global variable, or None if not set.
- Return type:
Any or None
Examples
>>> get_global_variable('device') 'cuda'