Computes the resulting broadcasted shape for a given set of arrays.
Raises an exception if the shapes do not broadcast.