salesforce / awd-lstm-lm

LSTM and QRNN Language Model Toolkit for PyTorch
BSD 3-Clause "New" or "Revised" License
1.96k stars 488 forks source link

Convert embedding dropout to a module making it pytorch 0.3 compliant. #18

Closed csarofeen closed 6 years ago

salesforce-cla[bot] commented 6 years ago

Thanks for the contribution! Before we can merge this, we need @csarofeen to sign the Salesforce Contributor License Agreement.

geniki commented 6 years ago

On PyTorch 0.3.0.post4, I get

  File "/.../awd-lstm-lm/embed_regularize.py", line 37, in forward
    self.scale_grad_by_freq, self.sparse
TypeError: embedding() takes from 2 to 6 positional arguments but 7 were given

I believe we don't need the self.padding_idx on line 37.