Template Function Pennylane::Util::chunkData

Function Documentation

template<template<typename...> class Container, typename T>
auto Pennylane::Util::chunkData(const Container<T> &data, std::size_t num_chunks) -> Container<Container<T>>

Chunk the data into the requested number of chunks.

Chunk the data into the requested number of chunks

Template Parameters
  • Container – STL container type

  • T – Data-type of STL container

Parameters
  • data – Data to chunk

  • num_chunks – Chunk size to use.

Returns

Container<Container<T>> Container of num_chunks {Containers of data}