Skip to content

Commit

Permalink
Update Transformer.py
Browse files Browse the repository at this point in the history
  • Loading branch information
da03 authored Jun 13, 2018
1 parent c199de0 commit c75a979
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 c75a979

Please sign in to comment.