pytorch
8f743d7a - [ao] Updated detector observer insert args to be vars not strings (#81382)

Commit
3 years ago
[ao] Updated detector observer insert args to be vars not strings (#81382) Summary: Before for the detectors, the determine_observer_insert_points() function for all of them would have hard coded strings as the keys for the dictionary that would be returned to the ModelReport instance, and those same hard-coded keys would be used to actually extract information from them. Since all detectors used the same string keys, these were just made default variables at the top of the detector.py file, and all detectors just used those. The same ones are imported and now used in ModelReport file as well. This way, there is less of a chance of an error because of incorrectly typed strings. The test plan primarily tests the ModelReport class because this uses the same new vars as well for the strings and is the primary one calling each of the detector instances' determine_observer_insert_points() Test Plan: python test/test_quantization.py TestFxModelReportClass Reviewers: Subscribers: Tasks: Tags: Pull Request resolved: https://github.com/pytorch/pytorch/pull/81382 Approved by: https://github.com/jerryzh168
Author
Committer
Parents
Loading