DataLoader<T> class

Yields fixed-size batches of items from a Dataset.

  • batchSize — items per batch.
  • shuffle — reshuffle the index order at every call to batches. Uses seed for determinism.
  • dropLast — drop the trailing short batch when dataset.length % batchSize != 0. Default keeps it.

Constructors

DataLoader(Dataset<T> dataset, {int batchSize = 1, bool shuffle = false, bool dropLast = false, int? seed})

Properties

batchSize int
final
dataset Dataset<T>
final
dropLast bool
final
hashCode int
The hash code for this object.
no setterinherited
length int
Number of batches produced per full iteration.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shuffle bool
final

Methods

batches() Iterable<List<T>>
Lazily produce one full pass over the dataset as batches.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited