Current ways of squeezing an array on a given dimension using rearrange are :
vals_squeezed = einx.rearrange('a 1 c -> a c', vals) # dim 'k' is not named here
vals_squeezed = einx.rearrange('a b c -> (a b) c', vals) # this is difficult to understand
Side note : trying to squeeze an array by providing b=1 raises an error :
vals_squeezed = einx.rearrange('a b c -> a c', vals, b=1)
# RuntimeError: Failed to find assignment between input and output expressions
Making rearrange be able to squeeze dimensions when their size is given as 1 could be convenient.
Yet, possibly providing a squeeze function would be more meaningful :
vals_squeezed = einx.squeeze('a b c -> a c', vals)
And btw ... thank you einx developers to help me make my array dimensions readable all along my code π.