numas/operator/mod.rs
1mod arithmetic;
2mod relational;
3
4use shape::Shape;
5
6
7/// Checks if shapes are compatible - have same dimensions and length or second one is unit array
8///
9/// # Arguments
10///
11/// * `first` - the first shape
12/// * `second` - the second shape
13#[inline]
14fn check_shapes_compatibility(first: &Shape, second: &Shape) -> () {
15 if first != second && second.total_len() != 1 {
16 panic!("Shapes are not compatible");
17 }
18}