calculate_matmul_output

Function calculate_matmul_output 

pub fn calculate_matmul_output(
    lhs: &Shape,
    rhs: &Shape,
) -> Result<Shape, ShapeError>
Expand description

Compute the output shape for matrix multiplication with broadcasting support.

The last two dimensions are treated as matrices, while preceding dimensions follow broadcast semantics similar to elementwise operations.