'Abstract method to loop over some data in batches.
# Arguments
f: Keras function returning a list of tensors.
ins: list of tensors to be fed to `f`.
batch_size: integer batch size.
verbose: verbosity mode.
# Returns
Array of predictions (if the model has a single output)
or list of arrays of predictions
(if the model has multiple outputs).'

def _predict_loop(self, f, ins, batch_size=32, verbose=0):

    if (ins and hasattr(ins[0], 'shape')):
        samples = ins[0].shape[0]
    else:
        samples = batch_size
        verbose = 2
    outs = []
    if (verbose == 1):
        progbar = Progbar(target=samples)
    batches = _make_batches(samples, batch_size)
    index_array = np.arange(samples)
    for (batch_index, (batch_start, batch_end)) in enumerate(batches):
        batch_ids = index_array[batch_start:batch_end]
        if (ins and isinstance(ins[(-1)], float)):
            ins_batch = (_slice_arrays(ins[:(-1)], batch_ids) + [ins[(-1)]])
        else:
            ins_batch = _slice_arrays(ins, batch_ids)
        batch_outs = f(ins_batch)
        if (not isinstance(batch_outs, list)):
            batch_outs = [batch_outs]
        if (batch_index == 0):
            for batch_out in batch_outs:
                shape = ((samples,) + batch_out.shape[1:])
                outs.append(np.zeros(shape, dtype=batch_out.dtype))
        for (i, batch_out) in enumerate(batch_outs):
            outs[i][batch_start:batch_end] = batch_out
        if (verbose == 1):
            progbar.update(batch_end)
    if (len(outs) == 1):
        return outs[0]
    return outs
