def split_ordered_batches(self, batch_size: int=None, num_batches: int=None):
    '\n        Batch generation. Split the step collection into ordered mini-batches of size batch_size.\n\n        :param batch_size: number of steps per batch, i.e. variable number of batches\n        :param num_batches: number of batches to split the rollout in, i.e. variable batch size\n\n        .. note::\n            Left out the option to return complete rollouts like for `split_shuffled_batches`.\n        '
    if (((batch_size is None) and (num_batches is None)) or ((batch_size is not None) and (num_batches is not None))):
        raise pyrado.ValueErr(msg='Either batch_size or num_batches must not be None, but not both or none!')
    elif ((batch_size is not None) and (batch_size < 1)):
        raise pyrado.ValueErr(given=batch_size, ge_constraint='1 (int)')
    elif ((num_batches is not None) and (num_batches < 1)):
        raise pyrado.ValueErr(given=num_batches, ge_constraint='1 (int)')
    if (num_batches is not None):
        batch_size = ceil((self.length / num_batches))
    if (batch_size >= self.length):
        (yield self)
    else:
        for b in gen_ordered_batch_idcs(batch_size, self.length, sorted=True):
            (yield self[b])
Batch generation. Split the step collection into ordered mini-batches of size batch_size.

:param batch_size: number of steps per batch, i.e. variable number of batches
:param num_batches: number of batches to split the rollout in, i.e. variable batch size

.. note::
    Left out the option to return complete rollouts like for `split_shuffled_batches`.
def split_ordered_batches(self, batch_size: int=None, num_batches: int=None):
    '\n        Batch generation. Split the step collection into ordered mini-batches of size batch_size.\n\n        :param batch_size: number of steps per batch, i.e. variable number of batches\n        :param num_batches: number of batches to split the rollout in, i.e. variable batch size\n\n        .. note::\n            Left out the option to return complete rollouts like for `split_shuffled_batches`.\n        '
    if (((batch_size is None) and (num_batches is None)) or ((batch_size is not None) and (num_batches is not None))):
        raise pyrado.ValueErr(msg='Either batch_size or num_batches must not be None, but not both or none!')
    elif ((batch_size is not None) and (batch_size < 1)):
        raise pyrado.ValueErr(given=batch_size, ge_constraint='1 (int)')
    elif ((num_batches is not None) and (num_batches < 1)):
        raise pyrado.ValueErr(given=num_batches, ge_constraint='1 (int)')
    if (num_batches is not None):
        batch_size = ceil((self.length / num_batches))
    if (batch_size >= self.length):
        (yield self)
    else:
        for b in gen_ordered_batch_idcs(batch_size, self.length, sorted=True):
            (yield self[b])