[jit] Make 7 nn modules into weak modules#12966
Closed
driazati wants to merge 29 commits intopytorch:masterfrom
driazati:mod_conv1
Closed
[jit] Make 7 nn modules into weak modules#12966driazati wants to merge 29 commits intopytorch:masterfrom driazati:mod_conv1
driazati wants to merge 29 commits intopytorch:masterfrom
driazati:mod_conv1
Conversation
added 21 commits
October 16, 2018 10:12
This PR adds weak module annotations to `Linear` and `Bilinear` `nn` modules and a test setup to generate corresponding expect files
Contributor
|
in person discussion: actually run the modules for comparison, use import/export to ensure they are script modules rather than python calls. avoid expect tests for everything because it will cause a lot of pain when we have a huge number of tests. |
Contributor
facebook-github-bot
left a comment
There was a problem hiding this comment.
driazati has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
laurentdupin
pushed a commit
to laurentdupin/pytorch
that referenced
this pull request
Apr 24, 2026
Summary: Depends on pytorch#12682 ([stacked diff](https://github.com/driazati/pytorch/compare/weak_mod...driazati:mod_conv1)) * Adds tests for weak module conversion that creates a `ScriptModule` that uses the weak module and checks its graph * Adds `torch._jit_internal.weak_module` tags to modules that already work * `Sigmoid` * `Tanh` * `Hardshrink` * `PReLU` * `Softsign` * `Tanhshrink` * `PairwiseDistance` Pull Request resolved: pytorch#12966 Differential Revision: D10559557 Pulled By: driazati fbshipit-source-id: dc4bea3aa744b3c44d4fa7dceefd97e951f824d0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #12682 (stacked diff)
ScriptModulethat uses the weak module and checks its graph@torch._jit_internal.weak_moduletags to modules that already workSigmoidTanhHardshrinkPReLUSoftsignTanhshrinkPairwiseDistance