Validates that it's legal to combine the tasks in 'batch' into a batch. Assumes the batch is non-empty.
| 305 | // Validates that it's legal to combine the tasks in 'batch' into a batch. |
| 306 | // Assumes the batch is non-empty. |
| 307 | static Status ValidateBatch(const Batch& batch) { |
| 308 | for (int task_idx = 0; task_idx < batch.num_tasks(); ++task_idx) { |
| 309 | const BatchTask& task = batch.task(task_idx); |
| 310 | |
| 311 | if (task.inputs.size() != batch.task(0).inputs.size()) { |
| 312 | return errors::InvalidArgument( |
| 313 | "Batching inputs must have equal number of edges"); |
| 314 | } |
| 315 | } |
| 316 | |
| 317 | return Status::OK(); |
| 318 | } |
| 319 | |
| 320 | // Returns the smallest entry in 'allowed_batch_sizes_' that is greater than |
| 321 | // or equal to 'batch_size'. If 'allowed_batch_sizes_' is empty, simply |
nothing calls this directly
no test coverage detected