title: Why do we "pack" the sequences in PyTorch?
body: <p>I was trying to replicate <a href="https://discuss.pytorch.org/t/simple-working-example-how-to-use-packing-for-variable-length-sequence-inputs-for-rnn/2120" rel="noreferrer">How to use packing for variable-length sequence inputs for rnn</a> but I guess I first need to understand why we need to &quot;pack&quot; the sequence.</p>
  <p>I understand why we &quot;pad&quot; them but why is &quot;packing&quot; (via <code>pack_padded_sequence</code>) necessary?</p>