Number of non-trivial dimensions.
Computes the number of non-trivial dimensions, i.e dimension with size equals to 1 and that doesn't participate to the shape's extent.