[tune] add accessible trial_info (#7378)

* add accessible trial_info

* trial name and info

* doc

* fix
gp

* Update doc/source/tune-package-ref.rst

* Apply suggestions from code review

* fix

* trial

* fixtest

* testfix
This commit is contained in:
Richard Liaw
2020-03-17 23:44:18 -07:00
committed by GitHub
parent 745b9d643d
commit ea10cd212c
8 changed files with 158 additions and 16 deletions
+22 -1
View File
@@ -64,4 +64,25 @@ def trial_dir():
return _session.logdir
__all__ = ["TrackSession", "session", "log", "trial_dir", "init", "shutdown"]
def trial_name():
"""Trial name for the corresponding trial of this Trainable.
This is not set if not using Tune.
"""
_session = get_session()
return _session.trial_name
def trial_id():
"""Trial id for the corresponding trial of this Trainable.
This is not set if not using Tune.
"""
_session = get_session()
return _session.trial_id
__all__ = [
"TrackSession", "session", "log", "trial_dir", "init", "shutdown",
"trial_name", "trial_id"
]