MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ValidateBatch

Method ValidateBatch

tensorflow/core/kernels/batch_kernels.cc:307–318  ·  view source on GitHub ↗

Validates that it's legal to combine the tasks in 'batch' into a batch. Assumes the batch is non-empty.

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

InvalidArgumentFunction · 0.85
num_tasksMethod · 0.45
taskMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected