Skip to content

Commit

Permalink
some code cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
l-k-11235 committed May 21, 2024
1 parent 2c4eded commit e9edb12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion onmt/modules/multi_headed_attn.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ def forward(
x = key_pad_mask
x = x.expand(-1, self.head_count // self.parallel_gpu, -1)
x = x.unsqueeze(3)
x = x.expand(-1, -1, -1, 128)
x = x.expand(-1, -1, -1, value.size(3))
value = value.masked_fill(x, 0)

self.layer_cache[1]["keys"] = key
Expand Down

0 comments on commit e9edb12

Please sign in to comment.