mirror of
https://github.com/wassname/ray.git
synced 2026-07-15 11:25:40 +08:00
Add ray.is_initialized() function. (#2818)
* Add ray.is_initialized() function. * Add assert.
This commit is contained in:
committed by
Philipp Moritz
parent
e7db54bdb0
commit
3f6ed537a4
@@ -1987,6 +1987,15 @@ def print_error_messages_raylet(worker):
|
||||
pass
|
||||
|
||||
|
||||
def is_initialized():
|
||||
"""Check if ray.init has been called yet.
|
||||
|
||||
Returns:
|
||||
True if ray.init has already been called and false otherwise.
|
||||
"""
|
||||
return ray.worker.global_worker.connected
|
||||
|
||||
|
||||
def print_error_messages(worker):
|
||||
"""Print error messages in the background on the driver.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user