More robust check of whether a class is defined in torch (#64083)
authorgmagogsfm <gmagogsfm@gmail.com>
Fri, 27 Aug 2021 15:49:54 +0000 (08:49 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 27 Aug 2021 15:55:35 +0000 (08:55 -0700)
commitad8eddbd808a97ac518ffd5b51d2c925803a1a3f
tree124fd4a5d09399f1d63d25452d56cbdc299106ea
parentf2c47cf4dbbdd0cafc1bd2118121c6eda3947f3f
More robust check of whether a class is defined in torch (#64083)

Summary:
This would prevent bugs for classes that
1) Is defined in a module that happens to start with `torch`, say `torchvision`
2) Is defined in torch but with an import alias like `import torch as th`

Pull Request resolved: https://github.com/pytorch/pytorch/pull/64083

Reviewed By: soulitzer

Differential Revision: D30598369

Pulled By: gmagogsfm

fbshipit-source-id: 9d3a7135737b2339c9bd32195e4e69a9c07549d4
torch/jit/_monkeytype_config.py