From 697bd02c60abdfc6e77daa7a870e80e4dcb92cb9 Mon Sep 17 00:00:00 2001 From: Tom Aarsen Date: Thu, 27 Oct 2022 13:25:51 +0200 Subject: [PATCH] Resolve dangerous default value [] as argument --- bitsandbytes/autograd/_functions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bitsandbytes/autograd/_functions.py b/bitsandbytes/autograd/_functions.py index c3b0ac6..a115437 100644 --- a/bitsandbytes/autograd/_functions.py +++ b/bitsandbytes/autograd/_functions.py @@ -50,8 +50,9 @@ class GlobalOutlierPooler: class MatMul8bit(torch.autograd.Function): @staticmethod - def forward(ctx, A, B, out=None, quant_type="vector", precision=[8, 8, 8]): - + def forward(ctx, A, B, out=None, quant_type="vector", precision=None): + if precision is None: + precision = [8, 8, 8] if precision[0] != 8: with torch.no_grad(): output = torch.matmul(A, B)