import tensorflow as tf

        else:
            action = env_.action_space.sample()
            observation, reward, done, info = env_.step(action)
            if done: break
            return_ += reward
    logger.info (f"render {cnt_} steps, return = {return_:.6f}")
    res = {'obs': obs, 'return': return_}
    return res

def eval_rollout(runner, p, des):
    logger.info(des)
    runner.reset()
    data, ep_infos = runner.run(p, FLAGS.plan.n_trpo_samples)
    logp = p(data.state).log_prob(data.action).reduce_sum(axis=1).reduce_mean()
    logp = tf.get_default_session().run(logp)
    print ("state_mean:", np.mean(data.state))
    print ("action_mean:", np.mean(data.action))
    print ("warmup_logpac_mean:", logp)

def testeval(policy, runner):
    runner.reset()
    _, ep_infos = runner.run(policy, FLAGS.rollout.n_test_samples)
    returns = [info['return'] for info in ep_infos]
    returns = np.mean(returns)
    return returns

def evaluate(settings, tag):
    res = {}
