Skip to content

Commit 1c9f606

Browse files
committed
Tweak uint64 xfail test
1 parent 3a374e4 commit 1c9f606

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

tests/tensor/test_math.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,25 +1417,31 @@ def _grad_list(self):
14171417
)
14181418
def test_uint(self, dtype):
14191419
itype = np.iinfo(dtype)
1420-
data = np.array([itype.min + 3, itype.min, itype.max - 5, itype.max], dtype)
1421-
n = as_tensor_variable(data)
1420+
data = np.array(
1421+
[itype.min + 3, itype.min, itype.max - 5, itype.max], dtype=dtype
1422+
)
1423+
n = vector("n", shape=(None,), dtype=dtype)
14221424

1423-
assert min(n).dtype == dtype
1424-
i_min = eval_outputs(min(n))
1425+
min_out = min(n)
1426+
assert min_out.dtype == dtype
1427+
i_min = function([n], min_out)(data)
14251428
assert i_min == itype.min
14261429

1427-
assert max(n).dtype == dtype
1428-
i_max = eval_outputs(max(n))
1430+
max_out = max(n)
1431+
assert max_out.dtype == dtype
1432+
i_max = function([n], max_out)(data)
14291433
assert i_max == itype.max
14301434

1431-
@pytest.mark.xfail(reason="Fails due to #770")
1435+
@pytest.mark.xfail(
1436+
condition=config.mode != "FAST_COMPILE", reason="Fails due to #770"
1437+
)
14321438
def test_uint64_special_value(self):
14331439
"""Example from issue #770"""
14341440
dtype = "uint64"
14351441
data = np.array([0, 9223372036854775], dtype=dtype)
1436-
n = as_tensor_variable(data)
1442+
n = vector("n", shape=(None,), dtype=dtype)
14371443

1438-
i_max = eval_outputs(max(n))
1444+
i_max = function([n], max(n))(data)
14391445
assert i_max == data.max()
14401446

14411447
def test_bool(self):

0 commit comments

Comments
 (0)