From fc9ccc8dddf781aa041094696fe188403842534a Mon Sep 17 00:00:00 2001 From: Douwe den Blanken Date: Tue, 28 Mar 2023 14:28:54 +0200 Subject: [PATCH] Fix UserWarning: Defining your __torch_function__ as a plain method is deprecated and will be an error in future, please define it as a classmethod. --- src/brevitas/quant_tensor/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/brevitas/quant_tensor/__init__.py b/src/brevitas/quant_tensor/__init__.py index a95b0ffdf..b1907589c 100644 --- a/src/brevitas/quant_tensor/__init__.py +++ b/src/brevitas/quant_tensor/__init__.py @@ -79,6 +79,7 @@ def training(self): else: return None + @classmethod def __torch_function__(self, func, types, args=(), kwargs=None): if kwargs is None: kwargs = {}