ray.train.context.TrainContext.get_trial_dir#

TrainContext.get_trial_dir() str[source]#

Log directory corresponding to the trial directory for a Tune session. If calling from a Train session, this will give the trial directory of its parent Tune session.

from ray import train, tune

def train_func(config):
    print(train.get_context().get_trial_dir())

tuner = tune.Tuner(train_func)
tuner.fit()
/Users/root/ray_results/train_func_2023-07-19_15-01-37/train_func_d620c_00000_0_2023-07-19_15-01-40

PublicAPI (beta): This API is in beta and may change before becoming stable.