Function infer_batch_size

Source
pub fn infer_batch_size(
    expected: &[Shape],
    actual: &[ConcreteShape],
) -> Result<Option<usize>, ShapeMismatch>
Expand description

Infer what the batch size should be for the given input shapes.

Returns:

  • Ok(Some(batch_size)) if the batch size can be inferred
  • Ok(None) if any batch size would fit
  • Err(ShapeMismatch) if no batch size would fit, either because there are conflicting requirements or because there is some other shape mismatch