pad_sequence: fix regression - support tensor (#72436)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/71365
Based on https://github.com/pytorch/pytorch/pull/72343
Thanks jbschlosser
Pull Request resolved: https://github.com/pytorch/pytorch/pull/72436
Reviewed By: bdhirsh
Differential Revision: D34117724
Pulled By: jbschlosser
fbshipit-source-id: e5d6599d0791025e18ab36ae16c417a91554bf64
(cherry picked from commit ffe8a0e41b7906920e392a9588347215ac44f46f)