How to return states of LSTM in MXNet?
The best emulation (although I didn't check full equivalency):

import mxnet as mx

SEQUENCE_LENGTH = 100

stack = mx.gluon.rnn.SequentialRNNCell()
stack.add(mx.gluon.rnn.LSTMCell(16, prefix='first')
stack.add(mx.gluon.rnn.LSTMCell(1, prefix='first')

x, _ = stack.unroll(length=SEQUENCE_LENGTH,
    inputs=x,
    layout='NTC',
    merge_outputs=True,
)


Here layout='NTC' is for the case when input shape is (samples, timesteps, channels).