Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions brainpy/math/tests/test_numpy_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,7 @@ def _update_tol(op):
return tol


@jtu.with_config(jax_numpy_dtype_promotion='standard')
class IndexedUpdateTest(jtu.JaxTestCase):

@parameterized.named_parameters(jtu.named_cases_from_sampler(lambda s: ({
Expand Down
11 changes: 3 additions & 8 deletions brainpy/math/tests/test_numpy_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ def wrapper(*args, **kw):
return wrapper


@jtu.with_config(jax_numpy_dtype_promotion='standard')
class LaxBackedNumpyTests(jtu.JaxTestCase):
"""Tests for LAX-backed Numpy implementation."""

Expand Down Expand Up @@ -4214,8 +4215,6 @@ def bm_fun(a, c):
else:
self._CompileAndCheck(bm_func(bm_fun), args_maker)


class u(jtu.JaxTestCase):
def _GetArgsMaker(self, rng, shapes, dtypes, np_arrays=True):
def f():
out = [rng(shape, dtype or jnp.float_)
Expand Down Expand Up @@ -4251,8 +4250,6 @@ def np_fun(index, shape):
self._CheckAgainstNumpy(np_fun, bm_func(bm_fun), args_maker)
self._CompileAndCheck(bm_func(bm_fun), args_maker)


class u1(jtu.JaxTestCase):
def testAstype(self):
rng = self.rng()
args_maker = lambda: [rng.randn(3, 4).astype("float32")]
Expand Down Expand Up @@ -5994,9 +5991,8 @@ def grad_test_spec(op, nargs, order, rng_factory, dtypes, name=None, tol=None):
GradSpecialValuesTestSpec(bm.sinc, [0.], 1),
]


@jtu.with_config(jax_numpy_dtype_promotion='standard')
class NumpyGradTests(jtu.JaxTestCase):

@parameterized.named_parameters(itertools.chain.from_iterable(
jtu.cases_from_list(
{"testcase_name": jtu.format_test_name_suffix(
Expand Down Expand Up @@ -6099,9 +6095,8 @@ def _dtypes_for_ufunc(name: str) -> Iterator[Tuple[str, ...]]:
else:
yield arg_dtypes


@jtu.with_config(jax_numpy_dtype_promotion='standard')
class NumpyUfuncTests(jtu.JaxTestCase):

@parameterized.named_parameters(
{"testcase_name": f"_{name}_{','.join(arg_dtypes)}",
"name": name, "arg_dtypes": arg_dtypes}
Expand Down