Skip to content

Commit

Permalink
Merge pull request #764 from OpenNMT/fix-transformer
Browse files Browse the repository at this point in the history
Fix #761
  • Loading branch information
da03 authored Jun 13, 2018
2 parents c199de0 + c75a979 commit e61589d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onmt/modules/Transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def __init__(self, size, hidden_size, dropout=0.1):
self.w_1 = nn.Linear(size, hidden_size)
self.w_2 = nn.Linear(hidden_size, size)
self.layer_norm = onmt.modules.LayerNorm(size)
self.dropout_1 = nn.Dropout(dropout)
# Save a little memory, by doing inplace.
self.dropout_1 = nn.Dropout(dropout, inplace=True)
self.relu = nn.ReLU(inplace=True)
self.dropout_2 = nn.Dropout(dropout)

Expand Down

0 comments on commit e61589d

Please sign in to comment.