Skip to content

Commit f2e2f7e

Browse files
committed
fixing imports for moved test
Summary: Test Plan: python test.py Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 7d4cabb Pull Request resolved: #6
1 parent af6fa35 commit f2e2f7e

File tree

7 files changed

+20
-20
lines changed

7 files changed

+20
-20
lines changed

test/test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414

1515
from torch.ao.quantization import MinMaxObserver, QConfigMapping
1616

17-
from dynamic_quant import (
17+
from torchao.quantization.dynamic_quant import (
1818
DynamicallyPerAxisQuantizedLinear,
1919
)
20-
from quant_api import (
20+
from torchao.quantization.quant_api import (
2121
apply_dynamic_quant,
2222
apply_weight_only_int8_quant,
2323
change_linear_weights_to_dqtensors,
2424
)
25-
from quant_primitives import (
25+
from torchao.quantization.quant_primitives import (
2626
dequantize_per_channel,
2727
dequantize_per_tensor,
2828
dynamically_quantize_per_channel,
@@ -33,17 +33,17 @@
3333
safe_int_mm,
3434
)
3535

36-
from smoothquant import (
36+
from torchao.quantization.smoothquant import (
3737
get_scale,
3838
replace_with_custom_fn_if_matches_filter,
3939
smooth_fq_linear_to_inference,
4040
SmoothFakeDynamicallyQuantizedLinear,
4141
swap_linear_with_smooth_fq_linear,
4242
)
43-
from subclass import (
43+
from torchao.quantization.subclass import (
4444
DynamicallyQuantizedLinearWeight,
4545
)
46-
from utils import (
46+
from torchao.quantization.utils import (
4747
apply_logging_hook,
4848
compute_error,
4949
compute_error as SQNR,

torchao/quantization/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
# This source code is licensed under the license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
from smoothquant import * # noqa: F403
8-
from quant_api import * # noqa: F403
9-
from subclass import * # noqa: F403
10-
from quant_primitives import * # noqa: F403
11-
from utils import * # noqa: F403
12-
from weight_only import * # noqa: F403
7+
from .smoothquant import * # noqa: F403
8+
from .quant_api import * # noqa: F403
9+
from .subclass import * # noqa: F403
10+
from .quant_primitives import * # noqa: F403
11+
from .utils import * # noqa: F403
12+
from .weight_only import * # noqa: F403
1313

1414
__all__ = [
1515
"DynamicallyPerAxisQuantizedLinear",

torchao/quantization/dynamic_quant.py

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

77
import torch
88
import torch.nn as nn
9-
from quant_primitives import (
9+
from .quant_primitives import (
1010
dynamically_quantize_per_channel,
1111
quant_int8_dynamic_per_token_linear,
1212
)

torchao/quantization/quant_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"""
1313

1414
import torch
15-
from dynamic_quant import (
15+
from .dynamic_quant import (
1616
DynamicallyPerAxisQuantizedLinear,
1717
)
18-
from subclass import (
18+
from .subclass import (
1919
DynamicallyQuantizedLinearWeight,
2020
)
21-
from weight_only import (
21+
from .weight_only import (
2222
WeightOnlyInt8QuantLinear,
2323
)
2424

torchao/quantization/smoothquant.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
import torch
1616
import torch.nn.functional as F
17-
import quant_api
17+
import torchao.quantization.quant_api as quant_api
1818

19-
from quant_primitives import (
19+
from .quant_primitives import (
2020
dynamically_quantize_per_channel,
2121
quant_int8_dynamic_per_token_linear,
2222
)

torchao/quantization/subclass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
import torch
8-
from quant_primitives import (
8+
from .quant_primitives import (
99
dequantize_per_channel,
1010
dynamically_quantize_per_channel,
1111
quant_int8_dynamic_per_token_linear,

torchao/quantization/weight_only.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# LICENSE file in the root directory of this source tree.
66

77
import torch
8-
from quant_primitives import (
8+
from .quant_primitives import (
99
dynamically_quantize_per_channel,
1010
)
1111

0 commit comments

Comments
 (0)