You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/03/15 08:00:51 UTC

[GitHub] pengzhao-intel commented on a change in pull request #10104: [WIP][MXNET-107] Fused RNN implementation for CPU

pengzhao-intel commented on a change in pull request #10104: [WIP][MXNET-107] Fused RNN implementation for CPU
URL: https://github.com/apache/incubator-mxnet/pull/10104#discussion_r174700741
 
 

 ##########
 File path: tests/python/unittest/test_operator.py
 ##########
 @@ -27,6 +27,83 @@
 from common import setup_module, with_seed
 import unittest
 
+def check_lstm_with_type(xpu, type1, type2, atol):
+    X = mx.sym.Variable('x')
+    Params = mx.sym.Variable('params')
+    HX = mx.sym.Variable('state')
+    CX = mx.sym.Variable('state_cell')
+    T, N, I, H, nd, nl = 4, 16, 800, 800, 1, 1
+    size = (I + H + 2) * H * 4 * nd;                # first layer
+    x1 = mx.random.uniform(-1, 1, (T, N, I), ctx=xpu, dtype=type1)
+    wx = mx.random.uniform(-1, 1, (4 * H, I), ctx=xpu,dtype=type1)
+    wh = mx.random.uniform(-1, 1, (4 * H, H), ctx=xpu,dtype=type1)
+    bx = mx.nd.zeros((4 * H,), ctx=xpu, dtype=type1)
+    bh = mx.nd.zeros((4 * H,), ctx=xpu, dtype=type1)
+    x1.attach_grad()
 
 Review comment:
   In case use stateful OP, what's your opinion @eric-haibin-lin ?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services