Skip to content

[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#12966
driazati wants to merge 29 commits intopytorch:masterfrom
driazati:mod_conv1

Conversation

@driazati
Copy link
Copy Markdown
Contributor

@driazati driazati commented Oct 23, 2018

Depends on #12682 (stacked diff)

  • 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

@driazati driazati changed the title Mod conv1 [jit] Make 13 nn modules into weak modules Oct 23, 2018
@zdevito
Copy link
Copy Markdown
Contributor

zdevito commented Oct 23, 2018

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.

@driazati driazati changed the title [jit] Make 13 nn modules into weak modules [jit] Make 7 nn modules into weak modules Oct 23, 2018
Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

driazati has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Copy Markdown
Contributor

@zdevito zdevito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hurray!

@ezyang ezyang added the merged label Jun 25, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants