I can’t find it right now in the cudnn docs, but I think cudnn (the underlying library that is called for lstm) takes batch_size as the second dimension. Presumably this is done for efficiency for the computation, but I don’t know the details.