A thatcher’s yard has notes of three words and notes of three pages next to roof stills. Why must variable-length text or audio be padded or packed before a batched forward pass?
Select an answer to reveal the explanation.
Short Explanation
Batches like neat rows. Short and long notes need padding or packing so they sit in one rectangular batch the network can run together.
Full Explanation
Neural network batches typically require a uniform tensor layout. Padding or packing aligns variable-length sequences so different lengths can participate in one forward pass. Padding does not rewrite meaning into identical sentences, nor does it exist to discard long examples or replace text with image axes.