Catch OSError when calling inspect.getfile (#113671)
Summary:
Fixes #111328
X-link: https://github.com/pytorch/pytorch/pull/113671
Approved by: https://github.com/Skylion007, https://github.com/williamwen42
Reviewed By: huydhn
Differential Revision: D51336642
Pulled By: yanboliang
fbshipit-source-id: 7f1aada2a7b3ab9611f35247394510d26889a35f