Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infer types for arguments of methods not invoked directly by monkeyty…
…pe (#57202) Summary: Support adding type annotations for class methods and nn.Module methods which are not invoked under the hood of MonkeyType ** Changes ** * This PR involves a slight change in how the example inputs are passed while scripting `class` and `nn.Module` objects. * The example inputs passed to `_script_pdt` is of the following format: - example_inputs= [(obj.method1, (arg_list)), (obj.method2, (arg_list)),] * For nn.Modules, to infer types for `forward` methods, example_inputs can be passed in two ways: - example_inputs= [(obj.forward, (arg_list, ))] - example_inputs = [(obj, (arg_list, ) )] Pull Request resolved: #57202 Reviewed By: desertfire Differential Revision: D28382827 Pulled By: nikithamalgifb fbshipit-source-id: 5481467f3e909493bf3f439ee312056943508534
- Loading branch information
1 parent
1de3525
commit 9063cb0
Showing
2 changed files
with
147 additions
and
19 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