def _partition(episodes):
    """Divides metrics data into true rollouts vs off-policy estimates."""

    from ray.rllib.evaluation.sampler import RolloutMetrics

    rollouts, estimates = [], []
    for e in episodes:
        if isinstance(e, RolloutMetrics):
            rollouts.append(e)
        elif isinstance(e, OffPolicyEstimate):
            estimates.append(e)
        else:
            raise ValueError("Unknown metric type: {}".format(e))
    return rollouts, estimates
def _partition ( episodes ) : from ray . rllib . evaluation . sampler import RolloutMetrics rollouts , estimates = [ ] , [ ] for e in episodes : if isinstance ( e , RolloutMetrics ) : rollouts . append ( e ) elif isinstance ( e , OffPolicyEstimate ) : estimates . append ( e ) else : raise ValueError ( "Unknown metric type: {}" . format ( e ) ) return rollouts , estimates
Divides metrics data into true rollouts vs off-policy estimates.