I use Pytorch 0.4
import torch
from torch.nn.utils.rnn import PackedSequence
#This is fine
PackedSequence(torch.tensor([ 1,  5,  8,  2,  6,  9,  3,  7,  4]), torch.tensor([ 3,  3,  2,  1]))
#This returns TypeError: __ new __() got an unexpected keyword argument ‘data’
PackedSequence(data=torch.tensor([ 1,  5,  8,  2,  6,  9,  3,  7,  4]), batch_sizes=torch.tensor([ 3,  3,  2,  1]))
Is this a bug?
BTW: I am trying to use https://github.com/huggingface/torchMoji
which uses PackedSequence to update a packed sequence