From 9a4a58e2a9d36a125ddfd8f7071cfc59bda8b583 Mon Sep 17 00:00:00 2001 From: Ganesan Ramalingam Date: Mon, 23 Dec 2024 10:08:23 -0800 Subject: [PATCH] Use callable to test callable --- onnxscript/rewriter/_ir_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onnxscript/rewriter/_ir_utils.py b/onnxscript/rewriter/_ir_utils.py index 9bee21642..cefbec823 100644 --- a/onnxscript/rewriter/_ir_utils.py +++ b/onnxscript/rewriter/_ir_utils.py @@ -89,7 +89,7 @@ def is_singleton_value( scalar = get_singleton_value(val) if scalar is None: return False - if isinstance(expected, Callable): + if callable(expected): return expected(scalar) if isinstance(expected, int): return expected == scalar