sxjscience commented on issue #10453: Bug of CuDNN RNN with variable sequence 
length
URL: 
https://github.com/apache/incubator-mxnet/issues/10453#issuecomment-379426878
 
 
   The following code, which always use `seq_len=500` will not trigger the seg 
fault. This is a very critical bug.
   
   ```python
   from mxnet.gluon.rnn import LSTM
   import mxnet as mx
   import numpy as np
   
   ctx = mx.gpu()
   lstm = LSTM(num_layers=1, hidden_size=200, dropout=0.0)
   lstm.initialize(ctx=ctx)
   batch_size = 32
   for seq_len in range(500, 10, -1):
       for repeat in range(10):
           real_seq_len = 500
           print(real_seq_len, repeat)
           inputs_nd = mx.nd.random.normal(0, 1, shape=(real_seq_len, 
batch_size, 200), ctx=ctx)
           out = lstm(inputs_nd)
           print(out[0].sum().asscalar())
           mx.nd.waitall()
   
   ```

----------------------------------------------------------------
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

Reply via email to