[Shape Inference] Set new shape according to precedence of dimType over previous value (#35910)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/35910
Reviewed By: iroot900
Differential Revision: D20802884
fbshipit-source-id: f8bdab5d5a8c7f71d564d18bd630425cb9f27c76