Bug fix in bound shape inferencer (#19729)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/19729
Accessing dims() without boundary check is not good.
Reviewed By: zrphercule
Differential Revision: D15078912
fbshipit-source-id: 3746d0c18261abeec0c4880c30430125928c3309