Skip to content

Commit f240714

Browse files
committed
Fix a bug due to the integer arithmetic in python2
1 parent cfa96e6 commit f240714

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/python/unittest/test_random.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def testSmall(data, repeat1, repeat2):
589589
assert len(count) == math.factorial(data.shape[0])
590590
# The outcomes must be uniformly distributed.
591591
for p in itertools.permutations(range(0, data.size - stride + 1, stride)):
592-
assert abs(count[str(mx.nd.array(p))] / repeat2 - 1 / math.factorial(data.shape[0])) < 0.01
592+
assert 1. * abs(count[str(mx.nd.array(p))] / repeat2 - 1. / math.factorial(data.shape[0])) < 0.01
593593
# Check symbol interface
594594
a = mx.sym.Variable('a')
595595
b = mx.sym.random.shuffle(a)

0 commit comments

Comments
 (0)