Closed
Description
I am trying to understand what is the correct way to understand when map_axis
will be operating on empty arrays.
The minimal example that is giving me problems is the following:
use ndarray::{Array2, Axis};
let a: Array2 = array![[]];
let axis = Axis(0);
The array is empty, hence all slices (both wrt the first and the second axis) don't contain any element.
But if I ask for
a.len_of(axis)
I get 1 as answer because the shape of the array is [1, 0]
. Should I combine the output len_of
with the product of the other entries in the shape (excluding the one I am to slice the array)?