mirror of
https://github.com/wassname/ray.git
synced 2026-08-07 11:27:43 +08:00
[tune] API revamp fix (#10518)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import copy
|
||||
import logging
|
||||
import os
|
||||
import inspect
|
||||
import threading
|
||||
import time
|
||||
@@ -152,6 +153,17 @@ class Tee(object):
|
||||
self.stream2.flush(*args, **kwargs)
|
||||
|
||||
|
||||
def env_integer(key, default):
|
||||
# TODO(rliaw): move into ray.constants
|
||||
if key in os.environ:
|
||||
value = os.environ[key]
|
||||
if value.isdigit():
|
||||
return int(os.environ[key])
|
||||
raise ValueError(f"Found {key} in environment, but value must "
|
||||
f"be an integer. Got: {value}.")
|
||||
return default
|
||||
|
||||
|
||||
def merge_dicts(d1, d2):
|
||||
"""
|
||||
Args:
|
||||
|
||||
Reference in New Issue
Block a user