Loading...
Searching...
No Matches
batch.h
Go to the documentation of this file.
Abstract base class for OpenNN datasets, owning samples, variables, and metadata.
Definition dataset.h:61
Definition adaptive_moment_estimation.h:14
bool is_gpu()
Returns true when the resolved configuration runs on a CUDA GPU.
Definition configuration.h:186
const vector< TensorView > & get_inputs() const
Returns the tensor views over the input buffer (device on GPU mode, host on CPU mode).
Definition batch.h:51
const TensorView & get_targets() const
Returns the tensor view over the target buffer (device on GPU mode, host on CPU mode).
Definition batch.h:60
~Batch()
Batch(const Index=0, const Dataset *=nullptr)
Constructs a batch sized for samples_number samples drawn from dataset.
Batch & operator=(Batch &&)=delete
void set(const Index=0, const Dataset *=nullptr)
Reconfigures the batch for a new size or dataset; reuses allocations when possible.
vector< TensorView > input_views_host_cache
Definition batch.h:105
Index get_samples_number() const
Returns the current sample count (set by fill(); may be < samples_number).
Batch(const Batch &)=delete
Batch(Batch &&)=delete
void fill(const vector< Index > &, const vector< Index > &, const vector< Index > &, const vector< Index > &, bool is_training=true, bool parallelize_samples=true)
Loads the indicated samples from the dataset into the batch buffers.
Batch & operator=(const Batch &)=delete
void print() const
Prints a human-readable summary of the batch shapes and contents.
bool is_empty() const
Returns true when the batch is uninitialized or holds zero samples.
Owning raw byte buffer that lives on CPU or CUDA memory, with aligned (re)allocation.
Definition tensor_utilities.h:166
Fixed-capacity small-vector describing tensor dimensions (rank up to MaxRank).
Definition tensor_utilities.h:42
Non-owning view over a tensor: pointer, shape, and data type with rich reshape helpers.
Definition tensor_utilities.h:293