pub fn reduced_shape(
input_shape: &[usize],
axes: &[usize],
keepdims: bool,
) -> Result<Vec<usize>, ReductionShapeError>Expand description
Compute the output shape for a reduction.
ยงExamples
use tenferro_ops::reduction::reduced_shape;
assert_eq!(reduced_shape(&[2, 3, 4], &[1], false).unwrap(), vec![2, 4]);
assert_eq!(reduced_shape(&[2, 3, 4], &[1], true).unwrap(), vec![2, 1, 4]);