Skip to content

Commit 97827d7

Browse files
committed
up
1 parent 5c9be75 commit 97827d7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/diffusers/quantizers/torchao/torchao_quantizer.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
from packaging import version
2525

26-
from ...utils import get_module_from_name, is_torch_available, is_torchao_available, logging
26+
from ...utils import get_module_from_name, is_torch_available, is_torch_version, is_torchao_available, logging
2727
from ..base import DiffusersQuantizer
2828

2929

@@ -33,8 +33,9 @@
3333

3434
if is_torch_available():
3535
import torch
36+
import torch.nn as nn
3637

37-
if version.parse(torch.__version__) >= version.parse('2.6'):
38+
if is_torch_version(">=", "2.5"):
3839
SUPPORTED_TORCH_DTYPES_FOR_QUANTIZATION = (
3940
# At the moment, only int8 is supported for integer quantization dtypes.
4041
# In Torch 2.6, int1-int7 will be introduced, so this can be visited in the future

0 commit comments

Comments
 (0)