Skip to content

Commit

Permalink
Let's hope tha this will get us the SDFG, such that we can locally de…
Browse files Browse the repository at this point in the history
…bug.
  • Loading branch information
philip-paul-mueller committed Feb 3, 2025
1 parent 29c5e10 commit b2dabf4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tests/numpy/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,18 @@ def get_rand_arr(ddesc):
if not isinstance(reference_result, (tuple, list)):
reference_result = [reference_result]
dace_result = [dace_result]
import json
ssdfg = dp.to_sdfg(**dace_input, use_cache=True)
ssdfg_json = ssdfg.to_json()
ssdf_json_str = json.dumps(ssdfg_json, indent=None)

for ref, val in zip(reference_result, dace_result):
if ref.dtype == np.float32:
assert np.allclose(ref, val, equal_nan=True, rtol=1e-3, atol=1e-5)
assert np.allclose(ref, val, equal_nan=True, rtol=1e-3, atol=1e-5), f"SDFG: {ssdf_json_str}"
else:
assert np.allclose(ref, val, equal_nan=True)
assert np.allclose(ref, val, equal_nan=True), f"SDFG: {ssdf_json_str}"
if check_dtype and not validation_func:
assert (ref.dtype == val.dtype)
assert (ref.dtype == val.dtype), f"SDFG: {ssdf_json_str}"

return test

Expand Down

0 comments on commit b2dabf4

Please sign in to comment.