[Shape Inference] Set new shape according to precedence of dimType over previous value (#36081)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/36081
Reviewed By: yinghai, ipiszy
Differential Revision: D20873112
fbshipit-source-id: a610f989b9edb830097fda7502c04400ddfb42f1