simplify reduction shape computation