Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort supported dtypes in host_callback_test.py #3020

Merged
merged 2 commits into from
May 9, 2020
Merged
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
5 changes: 4 additions & 1 deletion tests/host_callback_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def skip_if_jit_not_enabled():
if os.getenv("JAX_ENABLE_JIT_PRINT", "false") == "false":
raise SkipTest("print jit not enabled yet; use JAX_ENABLE_JIT_PRINT env.")

def supported_dtypes():
return sorted(jtu.supported_dtypes(), key=lambda x: onp.dtype(x).name)

class _TestingOutputStream(object):
"""Use as `output_stream` for tests."""

Expand Down Expand Up @@ -532,7 +535,7 @@ def body(c, x):
dtype=dtype,
nr_args=nr_args) for nr_args in [1, 2]
for shape in [(), (2,), (2, 3), (2, 3, 4)]
for dtype in jtu.supported_dtypes()))
for dtype in supported_dtypes()))
def test_jit_types(self, nr_args=2, dtype=np.int16, shape=(2,)):
if dtype in (np.complex64, np.complex128, np.bool_):
raise SkipTest(f"id_print jit not implemented for {dtype}.")
Expand Down