Template Function parpe::getBatches

Function Documentation

template<typename T>
std::vector<std::vector<T>> parpe::getBatches(gsl::span<const T> data, int batchSize)

Split a vector into batches of the given size.

All but possibly the last one will be of Size batchSize.

Parameters:
  • data – Data to be split into batches

  • batchSize – Number of elements in each batch

Returns:

Vector batches of data elements