def discounted_values(rollouts: Sequence[StepSequence], gamma: float, data_format: Optional[str]='torch'):
    '\n    Compute the discounted state values for multiple rollouts.\n\n    :param rollouts: input data\n    :param gamma: temporal discount factor\n    :param data_format: data format of the given\n    :return: state values for every time step in the rollouts (concatenated sequence across rollouts)\n    '
    if (data_format == 'torch'):
        return to.cat([to.from_numpy(discounted_value(ro, gamma).copy()).to(to.get_default_dtype()) for ro in rollouts])
    elif (data_format == 'numpy'):
        raise np.array([discounted_value(ro, gamma) for ro in rollouts])
    else:
        raise pyrado.ValueErr(given=data_format, eq_constraint="'torch' or 'numpy'")
Compute the discounted state values for multiple rollouts.

:param rollouts: input data
:param gamma: temporal discount factor
:param data_format: data format of the given
:return: state values for every time step in the rollouts (concatenated sequence across rollouts)
def discounted_values(rollouts: Sequence[StepSequence], gamma: float, data_format: Optional[str]='torch'):
    '\n    Compute the discounted state values for multiple rollouts.\n\n    :param rollouts: input data\n    :param gamma: temporal discount factor\n    :param data_format: data format of the given\n    :return: state values for every time step in the rollouts (concatenated sequence across rollouts)\n    '
    if (data_format == 'torch'):
        return to.cat([to.from_numpy(discounted_value(ro, gamma).copy()).to(to.get_default_dtype()) for ro in rollouts])
    elif (data_format == 'numpy'):
        raise np.array([discounted_value(ro, gamma) for ro in rollouts])
    else:
        raise pyrado.ValueErr(given=data_format, eq_constraint="'torch' or 'numpy'")