pub fn sum_ndarray(x: &NdArray, dim: i32) -> NdArray
non-inplace operation: sum the given specific dim