pub fn broadcast_in_dim_extent_error(
input: &[usize],
output: &[usize],
dims: &[usize],
) -> Option<BroadcastError>Expand description
Find a broadcast extent failure for an already structurally validated
BroadcastInDim mapping.
Structural mapping failures (wrong dimension count, an out-of-range axis,
or a duplicate axis) remain the caller’s axis/rank validation errors. This
helper owns only the shared rank/extent cases represented by
BroadcastError, so eager and traced callers can feed the result through
broadcast_error_to_validation.
§Examples
use tenferro_ops::broadcast::{broadcast_in_dim_extent_error, BroadcastError};
let error = broadcast_in_dim_extent_error(&[2, 3], &[2, 4], &[0, 1]);
assert!(matches!(error, Some(BroadcastError::IncompatibleInput { .. })));