eric-haibin-lin commented on a change in pull request #10104: [WIP] Fused RNN implementation for CPU URL: https://github.com/apache/incubator-mxnet/pull/10104#discussion_r174622363
########## 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: why do you need to manually attach grad?? ---------------------------------------------------------------- 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