Skip to content
Snippets Groups Projects
Commit 50761765 authored by Daniel Bauer's avatar Daniel Bauer :speech_balloon:
Browse files

always compare non-rounded values in floating to floating conversion

parent 37b90035
No related merge requests found
Pipeline #72450 passed with stages
in 2 minutes and 21 seconds
...@@ -61,8 +61,13 @@ def test_type_cast(gen_config, xp, from_type, to_type): ...@@ -61,8 +61,13 @@ def test_type_cast(gen_config, xp, from_type, to_type):
kfunc = kernel.compile() kfunc = kernel.compile()
kfunc(inp=inp, outp=outp) kfunc(inp=inp, outp=outp)
# rounding mode depends on platform if np.issubdtype(from_type, np.floating) and not np.issubdtype(
try: to_type, np.floating
):
# rounding mode depends on platform
try:
xp.testing.assert_array_equal(outp, truncated)
except AssertionError:
xp.testing.assert_array_equal(outp, rounded)
else:
xp.testing.assert_array_equal(outp, truncated) xp.testing.assert_array_equal(outp, truncated)
except AssertionError:
xp.testing.assert_array_equal(outp, rounded)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment