[fx2trt] fix a bug in conversion from negative dim to positive dim (#68360)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68360
Added a helper function to do this. Only use `mod` to convert negative dim to positive. Do nothing when it's already positive.
Previously in `getitem` if we are slicing to the very end, we will get the dimension wrong.
Test Plan: Add a unit test
Reviewed By: yinghai, wushirong
Differential Revision: D32432893
fbshipit-source-id: 3c5d6a578d92a15207a5e52802750f9ea7f272a9