Skip to content

Commit 9b7562a

Browse files
xylttgitee-org
authored andcommitted
update fastNLP/modules/encoder/seq2seq_encoder.py.
1 parent e4e6597 commit 9b7562a

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)