Example #1
0
def batch_gen_trials(flag_vals, _prev_trials_cb, max_trials=None, **kw):
    if kw:
        log.warning("ignoring batch config: %s", kw)
    max_trials = max_trials or DEFAULT_MAX_TRIALS
    trials = 0
    for trial_flag_vals in batch_util.expand_flags(flag_vals):
        if trials >= max_trials:
            return
        trials += 1
        yield trial_flag_vals
Example #2
0
def batch_gen_trials(flags, max_trials=None, label=None, **kw):
    if kw:
        log.warning("ignoring batch config: %s", kw)
    max_trials = max_trials or DEFAULT_MAX_TRIALS
    trials = 0
    trial_opts = {"label": label}
    for trial_flags in batch_util.expand_flags(flags):
        if trials >= max_trials:
            return
        trials += 1
        yield trial_flags, trial_opts