Rate this Page

Struct DataLoaderOptions#

Struct Documentation#

structDataLoaderOptions#

Options to configure aDataLoader.

Public Functions

DataLoaderOptions()=default#
inlineDataLoaderOptions(size_tbatch_size)#
inlineautobatch_size(constsize_t&new_batch_size)->decltype(*this)#

The size of each batch to fetch.

inlineautobatch_size(size_t&&new_batch_size)->decltype(*this)#
inlineconstsize_t&batch_size()constnoexcept#
inlinesize_t&batch_size()noexcept#
inlineautoworkers(constsize_t&new_workers)->decltype(*this)#

The number of worker threads to launch.

If zero, the main thread will synchronously perform the data loading.

inlineautoworkers(size_t&&new_workers)->decltype(*this)#
inlineconstsize_t&workers()constnoexcept#
inlinesize_t&workers()noexcept#
inlineautomax_jobs(conststd::optional<size_t>&new_max_jobs)->decltype(*this)#

The maximum number of jobs to enqueue for fetching by worker threads.

Defaults to two times the number of worker threads.

inlineautomax_jobs(std::optional<size_t>&&new_max_jobs)->decltype(*this)#
inlineconststd::optional<size_t>&max_jobs()constnoexcept#
inlinestd::optional<size_t>&max_jobs()noexcept#
inlineautotimeout(conststd::optional<std::chrono::milliseconds>&new_timeout)->decltype(*this)#

An optional limit on the time to wait for the next batch.

inlineautotimeout(std::optional<std::chrono::milliseconds>&&new_timeout)->decltype(*this)#
inlineconststd::optional<std::chrono::milliseconds>&timeout()constnoexcept#
inlinestd::optional<std::chrono::milliseconds>&timeout()noexcept#
inlineautoenforce_ordering(constbool&new_enforce_ordering)->decltype(*this)#

Whether to enforce ordering of batches when multiple are loaded asynchronously by worker threads.

Set tofalse for better performance if you do not care about determinism.

inlineautoenforce_ordering(bool&&new_enforce_ordering)->decltype(*this)#
inlineconstbool&enforce_ordering()constnoexcept#
inlinebool&enforce_ordering()noexcept#
inlineautodrop_last(constbool&new_drop_last)->decltype(*this)#

Whether to omit the last batch if it contains less thanbatch_size examples.

inlineautodrop_last(bool&&new_drop_last)->decltype(*this)#
inlineconstbool&drop_last()constnoexcept#
inlinebool&drop_last()noexcept#