| 58 | } |
| 59 | |
| 60 | std::vector<Example> |
| 61 | BatchReader::fill_batch_with_variable_increment(const size_t max_batch_size, |
| 62 | const BatchType batch_type) { |
| 63 | std::vector<Example> batch; |
| 64 | batch.reserve(max_batch_size); |
| 65 | |
| 66 | size_t total_increment = 0; |
| 67 | |
| 68 | while (!_next.empty()) { |
| 69 | const size_t cur_increment = get_batch_size_increment(_next, batch_type); |
| 70 | const size_t new_batch_size = total_increment + cur_increment; |
| 71 | |
| 72 | if (!batch.empty() && new_batch_size > max_batch_size) |
| 73 | break; |
| 74 | |
| 75 | batch.emplace_back(std::move(_next)); |
| 76 | total_increment += cur_increment; |
| 77 | _next = get_next_example(); |
| 78 | } |
| 79 | return batch; |
| 80 | } |
| 81 | |
| 82 | std::vector<Example> |
| 83 | BatchReader::get_next(const size_t max_batch_size, |
nothing calls this directly
no test coverage detected