When computing dropped dimensions, if any unit-dimension is preserved,
then that should not be accounted for in the dropped dimensions.
The side-effect of this is that there is some ambiguity in the
dimensions being dropped sometimes. It seems like the convention is
that the outermost dimensions are prefered to be dropped.
Fixes #60091