From 1587c1725e5abd2913b34ff9253e31510e802f85 Mon Sep 17 00:00:00 2001 From: Giuseppe Franco Date: Tue, 12 Sep 2023 12:45:01 +0000 Subject: [PATCH] Fix (gptq): linalg import fix --- src/brevitas/graph/gptq.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/brevitas/graph/gptq.py b/src/brevitas/graph/gptq.py index 716f2fb04..8f8ffb6ae 100644 --- a/src/brevitas/graph/gptq.py +++ b/src/brevitas/graph/gptq.py @@ -11,7 +11,12 @@ import warnings import torch -from torch.linalg import LinAlgError + +try: + from torch.linalg import LinAlgError +except: + LinAlgError = RuntimeError + import unfoldNd from brevitas.graph.calibrate import DisableEnableQuantization