mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
pytorch quantization ao migration phase 2: caffe2/test (#65832)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/65832 Renames `torch.quantization` to `torch.ao.quantization` in `caffe2/test` folder. ``` find caffe2/test/ -type f -name "*.py" -print0 | xargs -0 sed -i "s/torch\.quantization/torch.ao.quantization/g" HG: manually revert the files testing this migration hg revert caffe2/test/quantization/ao_migration/common.py hg revert caffe2/test/quantization/ao_migration/test_ao_migration.py ``` Test Plan: CI Reviewed By: z-a-f Differential Revision: D31275754 fbshipit-source-id: 4ed54a74525634feb0f47a26d071102e19c30049
This commit is contained in:
committed by
Facebook GitHub Bot
parent
dac35b3592
commit
227e37dd39
@ -514,10 +514,10 @@ class TestNNAPI(TestCase):
|
||||
if "quant" in kind:
|
||||
model = torch.nn.Sequential(model)
|
||||
model.eval()
|
||||
model.qconfig = torch.quantization.get_default_qconfig('qnnpack')
|
||||
model = torch.quantization.prepare(model)
|
||||
model.qconfig = torch.ao.quantization.get_default_qconfig('qnnpack')
|
||||
model = torch.ao.quantization.prepare(model)
|
||||
model(inp)
|
||||
model = torch.quantization.convert(model)
|
||||
model = torch.ao.quantization.convert(model)
|
||||
inp = qpt(inp, 1.0 / 16, 128)
|
||||
# I've seen numerical differences between QNNPACK and NNAPI,
|
||||
# but never more than 1 quantum, and never more than ~1% of
|
||||
@ -556,7 +556,7 @@ class TestNNAPI(TestCase):
|
||||
|
||||
if "quant" in kind:
|
||||
model = torch.nn.quantized.ConvTranspose2d(in_ch, out_ch, kernel)
|
||||
model.qconfig = torch.quantization.get_default_qconfig('qnnpack')
|
||||
model.qconfig = torch.ao.quantization.get_default_qconfig('qnnpack')
|
||||
inp = qpt(inp, 1.0 / 16, 128)
|
||||
# I've seen numerical differences between QNNPACK and NNAPI,
|
||||
# but never more than 1 quantum, and never more than ~10% of
|
||||
|
Reference in New Issue
Block a user