Add ray.is_initialized() function. (#2818)

* Add ray.is_initialized() function.

* Add assert.
This commit is contained in:
Robert Nishihara
2018-09-06 21:20:59 -07:00
committed by Philipp Moritz
parent e7db54bdb0
commit 3f6ed537a4
4 changed files with 33 additions and 4 deletions
+9
View File
@@ -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.