From 102b7f8d64270b32721367a76da02350326409b5 Mon Sep 17 00:00:00 2001 From: Giuseppe Franco Date: Tue, 12 Sep 2023 17:02:54 +0200 Subject: [PATCH] Fix (gptq): linalg import fix (#705) --- 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