import tensorflow as tf

        mean = tools.StreamingMean((), tf.float32, key)
        means.append(mean)
        updates.append(mean.submit(value))
    with tf.control_dependencies(updates):
        # message = 'step/' + '/'.join(metrics.keys()) + ' = '
        message = '{}: step/{} ='.format(name, '/'.join(metrics.keys()))
        gs = tf.train.get_or_create_global_step()
        print_metrics = tf.cond(
            tf.equal(step % every, 0),
            lambda: tf.print(message, [gs] + [mean.clear() for mean in means]),
            tf.no_op)
    return print_metrics


def collect_initial_episodes(config):
    items = config.random_collects.items()
