Skip to content

Commit 3acaa84

Browse files
committed
Tweak uint64 xfail test
1 parent ae0132f commit 3acaa84

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

tests/tensor/test_math.py

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,30 +1412,41 @@ def _grad_list(self):
14121412
"uint8",
14131413
"uint16",
14141414
"uint32",
1415-
pytest.param("uint64", marks=pytest.mark.xfail(reason="Fails due to #770")),
1415+
pytest.param(
1416+
"uint64",
1417+
marks=pytest.mark.xfail(
1418+
condition=config.mode != "FAST_COMPILE", reason="Fails due to #770"
1419+
),
1420+
),
14161421
),
14171422
)
14181423
def test_uint(self, dtype):
14191424
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)
1425+
data = np.array(
1426+
[itype.min + 3, itype.min, itype.max - 5, itype.max], dtype=dtype
1427+
)
1428+
n = vector("n", shape=(None,), dtype=dtype)
14221429

1423-
assert min(n).dtype == dtype
1424-
i_min = eval_outputs(min(n))
1430+
min_out = min(n)
1431+
assert min_out.dtype == dtype
1432+
i_min = function([n], min_out)(data)
14251433
assert i_min == itype.min
14261434

1427-
assert max(n).dtype == dtype
1428-
i_max = eval_outputs(max(n))
1435+
max_out = max(n)
1436+
assert max_out.dtype == dtype
1437+
i_max = function([n], max_out)(data)
14291438
assert i_max == itype.max
14301439

1431-
@pytest.mark.xfail(reason="Fails due to #770")
1440+
@pytest.mark.xfail(
1441+
condition=config.mode != "FAST_COMPILE", reason="Fails due to #770"
1442+
)
14321443
def test_uint64_special_value(self):
14331444
"""Example from issue #770"""
14341445
dtype = "uint64"
14351446
data = np.array([0, 9223372036854775], dtype=dtype)
1436-
n = as_tensor_variable(data)
1447+
n = vector("n", shape=(None,), dtype=dtype)
14371448

1438-
i_max = eval_outputs(max(n))
1449+
i_max = function([n], max(n))(data)
14391450
assert i_max == data.max()
14401451

14411452
def test_bool(self):

0 commit comments

Comments
 (0)