[ONNX] Move caffe2 import into `exportTest` in `test_models.py` (#82621)
`Caffe2` is optional lib. Move import into `exportTest` to prevent
unnecessary import error when other modules imports `test_models`
but does not run the test in caffe2 backend.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82621
Approved by: https://github.com/AllenTiTaiWang, https://github.com/abock