forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JIT] Add
__prepare_scriptable__
duck typing to allow replacing nn.…
…modules with scriptable preparations (pytorch#45645) Summary: Fixes pytorch#45072 As discussed with zdevito gchanan cpuhrsch and suo, this change allows developers to create custom preparations for their modules before scripting. This is done by adding a `__prepare_scriptable__` method to a module which returns the prepared scriptable module out-of-place. It does not expand the API surface for end users. Prior art by jamesr66a: pytorch#42244 cc: zhangguanheng66 Pull Request resolved: pytorch#45645 Reviewed By: dongreenberg, ngimel Differential Revision: D24039990 Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65
- Loading branch information
1 parent
6bb18b2
commit 1bf3dc5
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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