Thanks for the info!
I just debugged it and it looks like this line of code 166 is problematic, if you’ve set a CUDA tensor as the default tensor type.
Here is a small snippet to see that the cpu() call will be ignored, since the data will be rewrapped:
lengths = torch.as_tensor(lengths.cpu(), dtype=torch.int64)
lengths.type()
> 'torch.cuda.LongTensor'

Could you create a GitHub issue 27 and CC me there?
Let me know, if you don’t want to do it and I’ll create the issue. 
The current workaround would be to avoid setting the default device or use this small hotfix:
import torch
torch.set_default_tensor_type(torch.cuda.FloatTensor)
from torch.nn.utils.rnn import pack_padded_sequence, PackedSequence


def hotfix_pack_padded_sequence(input, lengths, batch_first=False, enforce_sorted=True):
    lengths = torch.as_tensor(lengths, dtype=torch.int64)
    lengths = lengths.cpu()
    if enforce_sorted:
        sorted_indices = None
    else:
        lengths, sorted_indices = torch.sort(lengths, descending=True)
        sorted_indices = sorted_indices.to(input.device)
        batch_dim = 0 if batch_first else 1
        input = input.index_select(batch_dim, sorted_indices)

    data, batch_sizes = \
        torch._C._VariableFunctions._pack_padded_sequence(input, lengths, batch_first)
    return PackedSequence(data, batch_sizes, sorted_indices)


T, B, C = 100, 10, 4  # longest sequence, batch_size, feature_size
input = torch.randn(T, B, C, device='cuda')
lengths, _ = torch.sort(torch.randint(1, 100, (10,)), descending=True)
print(input.type())
print(lengths.type())
pack_padded_sequence(input, lengths.cpu())  # Error due to default type set to CUDA
hotfix_pack_padded_sequence(input, lengths)