From b0154ab40fb695503d68fff21e88167563e97806 Mon Sep 17 00:00:00 2001 From: He Sichao <1310722434@qq.com> Date: Tue, 11 Jun 2024 17:51:01 +0800 Subject: [PATCH] Update _compat_numpy_funcs_bit_operation.py --- brainunit/math/_compat_numpy_funcs_bit_operation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brainunit/math/_compat_numpy_funcs_bit_operation.py b/brainunit/math/_compat_numpy_funcs_bit_operation.py index 280c22f..1325539 100644 --- a/brainunit/math/_compat_numpy_funcs_bit_operation.py +++ b/brainunit/math/_compat_numpy_funcs_bit_operation.py @@ -92,7 +92,7 @@ def wrap_elementwise_bit_operation_binary(func): def f(x, y, *args, **kwargs): if isinstance(x, Quantity) or isinstance(y, Quantity): raise ValueError(f'Expected integers, got {x} and {y}') - elif isinstance(x, (jax.Array, np.ndarray)) and isinstance(y, (jax.Array, np.ndarray, number)): + elif isinstance(x, (jax.Array, np.ndarray)) and isinstance(y, (jax.Array, np.ndarray, int, float)): return func(x, y, *args, **kwargs) else: raise ValueError(f'Unsupported types {type(x)} and {type(y)} for {func.__name__}')