This is an automated email from the ASF dual-hosted git repository.
zhasheng pushed a commit to branch v1.4.x
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/v1.4.x by this push:
new e7fe640 Updates tolerances for test_layer_bidirectional (#14682)
(#14908)
e7fe640 is described below
commit e7fe640192fa6f3fb1932303cd91ee0fe768cfd0
Author: perdasilva <[email protected]>
AuthorDate: Wed May 8 08:16:06 2019 +0200
Updates tolerances for test_layer_bidirectional (#14682) (#14908)
---
tests/python/unittest/test_gluon_rnn.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/python/unittest/test_gluon_rnn.py
b/tests/python/unittest/test_gluon_rnn.py
index eee3add..be4d4a6 100644
--- a/tests/python/unittest/test_gluon_rnn.py
+++ b/tests/python/unittest/test_gluon_rnn.py
@@ -22,8 +22,7 @@ import copy
from numpy.testing import assert_allclose
import unittest
from mxnet.test_utils import almost_equal, assert_almost_equal
-from common import assert_raises_cudnn_not_satisfied
-
+from common import assert_raises_cudnn_not_satisfied, with_seed
def test_rnn():
cell = gluon.rnn.RNNCell(100, prefix='rnn_')
@@ -244,6 +243,7 @@ def test_bidirectional():
@assert_raises_cudnn_not_satisfied(min_version='5.1.10')
+@with_seed()
def test_layer_bidirectional():
class RefBiLSTM(gluon.Block):
def __init__(self, size, **kwargs):
@@ -279,7 +279,7 @@ def test_layer_bidirectional():
ref_net_params[k.replace('l0', 'l0l0').replace('r0',
'r0l0')].set_data(weights[k])
data = mx.random.uniform(shape=(11, 10, in_size))
- assert_allclose(net(data).asnumpy(), ref_net(data).asnumpy())
+ assert_allclose(net(data).asnumpy(), ref_net(data).asnumpy(), rtol=1e-04,
atol=1e-02)