-
Notifications
You must be signed in to change notification settings - Fork 36
Allow torch._C to be recognized a module in torch.package in pytorch/multipy #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This pull request was exported from Phabricator. Differential Revision: D37630606 |
Codecov Report
@@ Coverage Diff @@
## main #91 +/- ##
==========================================
- Coverage 88.99% 88.94% -0.05%
==========================================
Files 65 65
Lines 3842 3862 +20
==========================================
+ Hits 3419 3435 +16
- Misses 423 427 +4
Continue to review full report at Codecov.
|
…multipy (pytorch#91) Summary: Pull Request resolved: pytorch#91 This pr addresses pytorch#82 and pytorch#44. A C extension module behaves a bit differently than a normal python package as it does not contain a `__path__` attribute. However, these modules still have information about their submodules. This PR also checks if a module is a C extension module and checks if the module we are looking for is in it's children. For example, if we are importing `torch._C._nn` we check if the parent `torch._C` is a C extension module if necessary, and then check if `torch._C._nn` is a proper child of `torch._C`. The corresponding PR in torch.package is pytorch/pytorch#80917 Differential Revision: D37630606 fbshipit-source-id: 65e549b66550d676a0e766a5f0c38b417f038a20
This pull request was exported from Phabricator. Differential Revision: D37630606 |
…multipy (pytorch#91) Summary: Pull Request resolved: pytorch#91 This pr addresses pytorch#82 and pytorch#44. A C extension module behaves a bit differently than a normal python package as it does not contain a `__path__` attribute. However, these modules still have information about their submodules. This PR also checks if a module is a C extension module and checks if the module we are looking for is in it's children. For example, if we are importing `torch._C._nn` we check if the parent `torch._C` is a C extension module if necessary, and then check if `torch._C._nn` is a proper child of `torch._C`. The corresponding PR in torch.package is pytorch/pytorch#80917 Differential Revision: D37630606 fbshipit-source-id: f18991665618291664a0b3b34c95f5dbb91247af
This pull request was exported from Phabricator. Differential Revision: D37630606 |
…multipy (pytorch#91) Summary: Pull Request resolved: pytorch#91 This pr addresses pytorch#82 and pytorch#44. A C extension module behaves a bit differently than a normal python package as it does not contain a `__path__` attribute. However, these modules still have information about their submodules. This PR also checks if a module is a C extension module and checks if the module we are looking for is in it's children. For example, if we are importing `torch._C._nn` we check if the parent `torch._C` is a C extension module if necessary, and then check if `torch._C._nn` is a proper child of `torch._C`. The corresponding PR in torch.package is pytorch/pytorch#80917 Reviewed By: d4l3k Differential Revision: D37630606 fbshipit-source-id: 19e6bb808b893aaab39790929e130eb0bbd62d91
This pull request was exported from Phabricator. Differential Revision: D37630606 |
…multipy (pytorch#91) Summary: Pull Request resolved: pytorch#91 This pr addresses pytorch#82 and pytorch#44. A C extension module behaves a bit differently than a normal python package as it does not contain a `__path__` attribute. However, these modules still have information about their submodules. This PR also checks if a module is a C extension module and checks if the module we are looking for is in it's children. For example, if we are importing `torch._C._nn` we check if the parent `torch._C` is a C extension module if necessary, and then check if `torch._C._nn` is a proper child of `torch._C`. The corresponding PR in torch.package is pytorch/pytorch#80917 Reviewed By: d4l3k Differential Revision: D37630606 fbshipit-source-id: ee562573ea4c0bbc43facc5ae9a0fc4ad8f29cd6
This pull request was exported from Phabricator. Differential Revision: D37630606 |
Summary:
This pr addresses #82 and #44.
A C extension module behaves a bit differently than a normal python package as it does not contain a
__path__
attribute. However, these modules still have information about their submodules. This PR also checks if a module is a C extension module and checks if the module we are looking for is in it's children.For example, if we are importing
torch._C._nn
we check if the parenttorch._C
is a C extension module if necessary, and then check iftorch._C._nn
is a proper child oftorch._C
.The corresponding PR in torch.package is pytorch/pytorch#80917
Differential Revision: D37630606