The docs 35 are generally a good starting point.
This code should work for the padding approach:
target_len = 58672
x = torch.randn(1, 1256)
x = F.pad(x, (target_len - x.size(1), 0))
print(x.shape)
>  torch.Size([1, 58672])