Skip to content

Commit c49c849

Browse files
WillQvQgitee-org
authored andcommitted
!4 update fastNLP/modules/encoder/seq2seq_encoder.py.
Merge pull request !4 from 刘向阳/N/A
2 parents e4e6597 + 9b7562a commit c49c849

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fastNLP/modules/encoder/seq2seq_encoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def forward(self, tokens, seq_len):
132132
x = self.input_fc(x)
133133
x = F.dropout(x, p=self.dropout, training=self.training)
134134

135-
encoder_mask = seq_len_to_mask(seq_len)
135+
encoder_mask = seq_len_to_mask(seq_len, max_len=max_src_len)
136136
encoder_mask = encoder_mask.to(device)
137137

138138
for layer in self.layer_stacks:

0 commit comments

Comments
 (0)