[rllib] RLlib CLI (#2375)

This commit is contained in:
Richard Liaw
2018-07-12 19:12:04 +02:00
committed by GitHub
parent 54487b1d7f
commit 0048e77093
8 changed files with 162 additions and 72 deletions
+12 -3
View File
@@ -44,10 +44,19 @@ def _tune_error(msg):
raise TuneError(msg)
def make_parser(**kwargs):
"""Returns a base argument parser for the ray.tune tool."""
def make_parser(parser_creator=None, **kwargs):
"""Returns a base argument parser for the ray.tune tool.
parser = argparse.ArgumentParser(**kwargs)
Args:
parser_creator: A constructor for the parser class.
kwargs: Non-positional args to be passed into the
parser class constructor.
"""
if parser_creator:
parser = parser_creator(**kwargs)
else:
parser = argparse.ArgumentParser(**kwargs)
# Note: keep this in sync with rllib/train.py
parser.add_argument(