[tune] using None as the parameter default value instead of mutable dict (#1501)

* do not use dict as default parameter

* Update trial.py
This commit is contained in:
the-sea
2018-02-02 21:47:51 -08:00
committed by Eric Liang
parent 369773d3e8
commit a936468f99
3 changed files with 15 additions and 12 deletions
+3 -1
View File
@@ -63,7 +63,7 @@ class Agent(Trainable):
_allow_unknown_subkeys = []
def __init__(
self, config={}, env=None, registry=get_registry(),
self, config=None, env=None, registry=get_registry(),
logger_creator=None):
"""Initialize an RLLib agent.
@@ -77,6 +77,8 @@ class Agent(Trainable):
object. If unspecified, a default logger is created.
"""
config = config or {}
# Agents allow env ids to be passed directly to the constructor.
self._env_id = env or config.get("env")
Trainable.__init__(self, config, registry, logger_creator)