Skip to content

Commit

Permalink
Fix import failure in PyTorch 1.x (#3468)
Browse files Browse the repository at this point in the history
Signed-off-by: Kyunggeun Lee <quic_kyunggeu@quicinc.com>
  • Loading branch information
quic-kyunggeu authored Nov 7, 2024
1 parent 62be1ba commit c718d18
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion TrainingExtensions/torch/src/python/aimet_torch/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,15 @@
import torch
from torch.utils.data import DataLoader, Dataset
from torch.nn.modules.module import (
_global_backward_pre_hooks,
_global_backward_hooks,
_global_forward_pre_hooks,
_global_forward_hooks,
)
try:
from torch.nn.modules.module import _global_backward_pre_hooks
except ImportError:
_global_backward_pre_hooks = None

from torchvision import datasets, transforms

from aimet_common.defs import QuantScheme, QuantizationDataType, MAP_QUANT_SCHEME_TO_PYMO
Expand Down

0 comments on commit c718d18

Please sign in to comment.