zhifu gao
2023-03-30 55fb1f74580669793118d6373c89d8c3f7a0d8ef
Merge pull request #315 from xiaowan0322/fix/fx

[Quantization] import torch.fx only if torch.__version__ >= 1.8
1个文件已修改
4 ■■■■ 已修改文件
funasr/export/models/modules/multihead_att.py 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/export/models/modules/multihead_att.py
@@ -75,8 +75,8 @@
    return x, cache
torch_version = float(".".join(torch.__version__.split(".")[:2]))
if torch_version >= 1.8:
torch_version = tuple([int(i) for i in torch.__version__.split(".")[:2]])
if torch_version >= (1, 8):
    import torch.fx
    torch.fx.wrap('preprocess_for_attn')