IBM / pytorch-seq2seq

An open source framework for seq2seq models in PyTorch.
https://ibm.github.io/pytorch-seq2seq/public/index.html
Apache License 2.0
1.5k stars 376 forks source link

Fix RuntimeError when use_attention is set to False #182

Closed amjltc295 closed 5 years ago

amjltc295 commented 5 years ago

Why

When use_attention is set to False, we will get RuntimeError. See #181

How

Add the missing contiguous() when attention is set to False

I'm not sure if it is the correct solution, but it should have the same effect as #112m .