diff --git a/brainpy/_src/math/compat_numpy.py b/brainpy/_src/math/compat_numpy.py index 0eb39145..ddbaafd3 100644 --- a/brainpy/_src/math/compat_numpy.py +++ b/brainpy/_src/math/compat_numpy.py @@ -10,7 +10,6 @@ from .interoperability import * from .ndarray import Array - __all__ = [ 'full', 'full_like', 'eye', 'identity', 'diag', 'tri', 'tril', 'triu', 'empty', 'empty_like', 'ones', 'ones_like', 'zeros', 'zeros_like', @@ -204,11 +203,12 @@ def ascontiguousarray(a, dtype=None, order=None): return asarray(a, dtype=dtype, order=order) -def asfarray(a, dtype=np.float_): +def asfarray(a, dtype=None): if not np.issubdtype(dtype, np.inexact): - dtype = np.float_ + dtype = np.float64 return asarray(a, dtype=dtype) + def in1d(ar1, ar2, assume_unique: bool = False, invert: bool = False) -> Array: del assume_unique ar1_flat = ravel(ar1) @@ -227,6 +227,7 @@ def in1d(ar1, ar2, assume_unique: bool = False, invert: bool = False) -> Array: else: return asarray((ar1_flat[:, None] == ar2_flat[None, :]).any(-1)) + # Others # ------ meshgrid = _compatible_with_brainpy_array(jnp.meshgrid) @@ -454,7 +455,6 @@ def msort(a): sometrue = any - def shape(a): """ Return the shape of an array. @@ -648,7 +648,6 @@ def size(a, axis=None): finfo = jnp.finfo iinfo = jnp.iinfo - can_cast = _compatible_with_brainpy_array(jnp.can_cast) choose = _compatible_with_brainpy_array(jnp.choose) copy = _compatible_with_brainpy_array(jnp.copy)