986e3c0a00677355c1edbd89a959264fa0aea1c4,test/quantization/test_numeric_suite_fx.py,TestFXNumericSuiteCoreAPIsModels,test_sparsenn_compare_activations,#TestFXNumericSuiteCoreAPIsModels#,989
Before Change
sparse_nn(idx, offsets, x)
// convert
sparse_nn_q = copy.deepcopy(sparse_nn)
sparse_nn_q.dense_top = convert_fx(sparse_nn_q.dense_top)
// test out compare activations API
sparse_nn.dense_top, sparse_nn_q.dense_top = add_loggers(
"fp32_prepared", sparse_nn.dense_top, "int8", sparse_nn_q.dense_top, OutputLogger,
should_log_inputs=should_log_inputs)
// calibrate
sparse_nn(idx, offsets, x)
sparse_nn_q(idx, offsets, x)
After Change
idx = torch.LongTensor([1, 2, 4, 5, 4, 3, 2, 9])
offsets = torch.LongTensor([0, 4])
x = torch.randn(2, 4)
self._test_match_activations(
sparse_nn, (idx, offsets, x),
results_len=4,
should_log_inputs=should_log_inputs)
@skipIfNoFBGEMM
def test_sparsenn_shadow(self):
for should_log_inputs in (True, False):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: pytorch/pytorch
Commit Name: 986e3c0a00677355c1edbd89a959264fa0aea1c4
Time: 2021-03-12
Author: vasiliy@fb.com
File Name: test/quantization/test_numeric_suite_fx.py
Class Name: TestFXNumericSuiteCoreAPIsModels
Method Name: test_sparsenn_compare_activations
Project Name: pytorch/pytorch
Commit Name: 986e3c0a00677355c1edbd89a959264fa0aea1c4
Time: 2021-03-12
Author: vasiliy@fb.com
File Name: test/quantization/test_numeric_suite_fx.py
Class Name: TestFXNumericSuiteCoreAPIs
Method Name: test_match_activations_mod
Project Name: pytorch/pytorch
Commit Name: 986e3c0a00677355c1edbd89a959264fa0aea1c4
Time: 2021-03-12
Author: vasiliy@fb.com
File Name: test/quantization/test_numeric_suite_fx.py
Class Name: TestFXNumericSuiteCoreAPIs
Method Name: test_match_activations_fun