


seq_unpacked, lens_unpacked = pad_packed_sequence(packed, batch_first=True)
seq_unpacked
   tensor([[1, 2, 0],
           [3, 0, 0],
           [4, 5, 6]])
lens_unpacked
   tensor([2, 1, 3])



Note:
 "total_length" is useful to implement the "pack sequence ->
 recurrent network -> unpack sequence" pattern in a "Module"
 wrapped in "DataParallel". See this FAQ section for details.

Parameters:
      * sequence (PackedSequence) -- batch to pad
  * **batch_first** (*bool**, **optional*) -- if "True", the
    output will be in "B x T x *" format.

  * **padding_value** (*float**, **optional*) -- values for padded
    elements.

  * **total_length** (*int**, **optional*) -- if not "None", the
    output will be padded to have length "total_length". This
    method will throw "ValueError" if "total_length" is less than
    the max sequence length in "sequence".

Returns: