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.

Return

Vector batches of data elements

Parameters
  • data: Data to be split into batches

  • batchSize: Number of elements in each batch