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

bump to torch 1.5.0, fix style #21

Closed topshik closed 3 years ago

topshik commented 4 years ago

fix: make code torch 1.5.0 compatible fix: PEP8 code style issues del: deprecated torch methods and api

Inference script unreliably falls with error on line 172, needs to be fixed.

frederictamagnan commented 3 years ago

It looks like the the input_sequence tensor is turning into a zero-dimensional tensor when the running_seqs tensor has a size of 1 at the previous iteration, because of the slicing operation input_sequence = input_sequence[running_seqs]

if input_sequence.size()==torch.Size([]): 
  input_sequence=input_sequence.unsqueeze(0)
topshik commented 3 years ago

Yes, actually, I have some more fixes to the code, which makes it a lot prettier and more usable. I'll update merge request in a week or too.

timbmg commented 3 years ago

LGTM, thanks!