When LSTM in contrast to LSTMCell consumes a sequence.
In this small gist I demonstrate it’s usage with batches:

  
      gist.github.com
  
  
    https://gist.github.com/lochbrunner/d9c77c3fbfd5301154c070561e294ed7#file-bieber_lstm-py-L139 179
bieber_lstm.py
#!/usr/bin/env python

import torch
import torch.nn as nn
import torch.nn.utils.rnn as rnn
import torch
import torch.optim as optim
from torch.utils.data import Dataset, DataLoader
from torch.nn import functional as F

This file has been truncated. show original