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.
ns for fx: expose hook to define custom weight extraction functions (p…
…ytorch#62047) Summary: Pull Request resolved: pytorch#62047 Adds a hook for user to define a weight extraction function for a custom type. Example usage: ``` op_to_type_to_weight_extraction_fn = \ get_op_to_type_to_weight_extraction_fn() op_to_type_to_weight_extraction_fn['call_function'][_wrapped_linear] = \ torch.quantization.ns.weight_utils.get_linear_fun_weight results = extract_weights_impl( 'a', m1, 'b', m2, op_to_type_to_weight_extraction_fn=op_to_type_to_weight_extraction_fn) ``` Test Plan: ``` python test/test_quantization.py TestFXNumericSuiteCoreAPIs.test_user_defined_function ``` Imported from OSS Reviewed By: jerryzh168 Differential Revision: D29853625 fbshipit-source-id: 183916ef54ba303bc818e0eba00b52e33c4633ad
- Loading branch information
1 parent
07c6a12
commit 04c95a0
Showing
3 changed files
with
109 additions
and
65 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