Skip to content

Commit e3af4be

Browse files
vkuzofacebook-github-bot
authored andcommitted
pytorch quantization ao migration phase 2: caffe2/benchmark (#65833)
Summary: Pull Request resolved: #65833 Renames `torch.quantization` to `torch.ao.quantization` in `caffe2/benchmarks` folder. ``` find caffe2/benchmarks/ -type f -name "*.py" -print0 | xargs -0 sed -i "s/torch\.quantization/torch.ao.quantization/g" ``` Test Plan: CI Reviewed By: z-a-f Differential Revision: D31275963 fbshipit-source-id: 8596bf28df5c3ad2c4490ac8abb285d6517c0116
1 parent c1447f0 commit e3af4be

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

benchmarks/operator_benchmark/pt/qobserver_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
import operator_benchmark as op_bench
33
import torch
4-
import torch.quantization.observer as obs
4+
import torch.ao.quantization.observer as obs
55

66
qobserver_short_configs_dict = {
77
'attr_names': ('C', 'M', 'N', 'dtype', 'device'),

benchmarks/operator_benchmark/pt/qrnn_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ def init(self, I, H, NL, B, D, dtype):
4141
bidirectional=D,
4242
)
4343
cell_temp = nn.Sequential(cell_nn)
44-
self.cell = torch.quantization.quantize_dynamic(cell_temp,
45-
{nn.LSTM, nn.Linear},
46-
dtype=dtype)[0]
44+
self.cell = torch.ao.quantization.quantize_dynamic(cell_temp,
45+
{nn.LSTM, nn.Linear},
46+
dtype=dtype)[0]
4747

4848
x = torch.randn(sequence_len, # sequence length
4949
batch_size, # batch size

benchmarks/operator_benchmark/pt/quantization_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import operator_benchmark as op_bench
33
import torch
44
import torch.nn.quantized as nnq
5-
import torch.quantization as tq
5+
import torch.ao.quantization as tq
66
import torch.nn as nn
77

88
"""Microbenchmarks for general quantization operations."""

0 commit comments

Comments
 (0)