timbmg / Sentence-VAE

PyTorch Re-Implementation of "Generating Sentences from a Continuous Space" by Bowman et al 2015 https://arxiv.org/abs/1511.06349
580 stars 152 forks source link

maybe a bug in the train.py #18

Closed linzhk closed 3 years ago

linzhk commented 4 years ago

I got a bug in the following code: target = target[:, :torch.max(length).data[0]].contiguous().view(-1) and it fixed when I change code into: target = target[:, :torch.max(length).data].contiguous().view(-1)

kevinling0218 commented 4 years ago

the original code is supported by pytorch 0.4.X, which data[0] can be used

timbmg commented 3 years ago

fixed by #21