Fix TypeError when torch.jit.load is passed a pathlib.Path (#45825)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/45824
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45825
Reviewed By: VitalyFedyunin
Differential Revision: D24129441
Pulled By: gmagogsfm
fbshipit-source-id: 52a76e39c163206cee2d19967e333e948adefe99