mirror of
https://github.com/wassname/ray.git
synced 2026-07-16 11:21:10 +08:00
[tune] check for running session (#10840)
This commit is contained in:
@@ -7,6 +7,12 @@ logger = logging.getLogger(__name__)
|
||||
_session = None
|
||||
|
||||
|
||||
def is_session_enabled() -> bool:
|
||||
"""Returns True if running within an Tune process."""
|
||||
global _session
|
||||
return _session is not None
|
||||
|
||||
|
||||
def get_session():
|
||||
global _session
|
||||
if not _session:
|
||||
|
||||
Reference in New Issue
Block a user