Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Fixes flaky test_gluon_rnn.py:test_layer_bidirectional #14682

Merged
merged 1 commit into from
Apr 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/python/unittest/test_gluon_rnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
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_')
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -279,7 +279,7 @@ def forward(self, inpt):
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)



Expand Down