NEML2 2.0.0
|
Interface for work generators that generate a fixed number of batches, i.e., the total amount of work is known at construction time. More...
Interface for work generators that generate a fixed number of batches, i.e., the total amount of work is known at construction time.
#include <FixedSizeWorkGenerator.h>
Public Member Functions | |
bool | has_more () const override |
Whether the generator has more work to generate. | |
virtual std::size_t | total () const =0 |
Total (fixed) number of batches that will be generated. | |
![]() | |
WorkGenerator ()=default | |
WorkGenerator (WorkGenerator &&) noexcept=default | |
WorkGenerator (const WorkGenerator &)=default | |
WorkGenerator & | operator= (WorkGenerator &&) noexcept=default |
WorkGenerator & | operator= (const WorkGenerator &)=default |
virtual | ~WorkGenerator ()=default |
std::pair< std::size_t, T > | next (std::size_t n) |
Generate the next n batches of work. | |
std::size_t | offset () const |
Return the current offset, i.e., the number of batches that have been generated. | |
Additional Inherited Members | |
![]() | |
virtual std::pair< std::size_t, T > | generate (std::size_t n)=0 |
Generate the next n batches of work. | |
|
inlineoverridevirtual |
Whether the generator has more work to generate.
Implements WorkGenerator< T >.
|
pure virtual |
Total (fixed) number of batches that will be generated.
Implemented in SliceGenerator, TensorLoader, and ValueMapLoader.