MCPcopy Create free account
hub / github.com/ml-explore/mlx-data / Batch

Method Batch

mlx/data/stream/Batch.cpp:11–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace data {
10namespace stream {
11Batch::Batch(
12 const std::shared_ptr<Stream>& stream,
13 int64_t batch_size,
14 const std::unordered_map<std::string, double>& pad_values,
15 const std::unordered_map<std::string, int>& batch_dims)
16 : stream_(stream),
17 batchSize_(batch_size),
18 padValues_(pad_values),
19 batchDims_(batch_dims) {
20 if (batch_size <= 0) {
21 throw std::runtime_error("Batch: batch size must be positive");
22 }
23}
24
25Sample Batch::next() const {
26 std::vector<Sample> samples;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected