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 (#45645) Summary: Fixes #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: #42244 cc: zhangguanheng66 Reviewed By: dongreenberg, ngimel Differential Revision: D24039990 Pulled By: zhangguanheng66 fbshipit-source-id: 4ddff2d353124af9c2ef22db037df7e3d26efe65 ghstack-source-id: 8cf5a7723a1fbde418800d55389ac2f588bb05bd Pull Request resolved: #49242
- Loading branch information
Meghan Lele
committed
Dec 11, 2020
1 parent
f4226b5
commit 7f4f975
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