Move empty check to the start of _pack_padded_sequence (#94885)
Fixes #94122.
Move empty check to the start of `_pack_padded_sequence`.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/94885
Approved by: https://github.com/kshitij12345, https://github.com/jgong5, https://github.com/malfet