[JIT] Cat shape analysis fix for -1 dim (#72616)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72616
Following logic [here](https://codebrowser.bddppq.com/pytorch/pytorch/aten/src/ATen/WrapDimUtils.h.html#_ZN2atL19legacy_cat_wrap_dimElN3c108ArrayRefINS_6TensorEEE)
The prior version was checking if dim was not None, we should be checking if it's None. Strangely, the shape analysis still worked because the negative indexing just wrapped around, however it would lead to errors in executing shape functions. In follow up I will extend shape functions testing to actually invoke shape functions as well to catch this type of bug.
This wasn't caught in the nnc opinfo tests bc nnc was already failing for cat single-node :'(
Test Plan: Imported from OSS
Reviewed By: Krovatkin
Differential Revision: D34117930
Pulled By: eellison
fbshipit-source-id: 2c60430d7144dc828a6a4789e0015b83153f7a32
(cherry picked from commit 3ee820753fca0b82c4647aa4fadff5e1e62f2d48)