It is not necessary to use outputs produced using padding zeros.


if you’re using hidden state as RNN result, packed sequences 27 support variable length sequences


if you’re using regular output (with time dimension), you can create a loss mask from sequence lengths, so that padding locations produce zero gradients.