Jerryzcn commented on a change in pull request #9977: Cpu lstm inference URL: https://github.com/apache/incubator-mxnet/pull/9977#discussion_r173387210
########## File path: tests/python/unittest/test_gluon_rnn.py ########## @@ -67,6 +67,22 @@ def test_lstm_forget_bias(): forget_bias * np.ones(100, ), np.zeros((2 * 100,))]) assert_allclose(mod.get_params()[0][bias_argument].asnumpy(), expected_bias) +def test_lstm_cpu_inference(): + # should behave the same as lstm cell + atol = 1e-6 + x = mx.nd.ones(shape=(2, 2, 2)) + model = mx.gluon.nn.Sequential() + with model.name_scope(): + model.add(mx.gluon.rnn.LSTM(2, num_layers=6, bidirectional=True)) + model.initialize(mx.init.One()) + y = model(x).asnumpy() + + mx.test_utils.assert_almost_equal(y, np.array([[[0.72045636, 0.72045636, 0.95215213, 0.95215213], Review comment: https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/test_utils.py#L1207 is for symbol it seems. or does it support both? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services