mirror of
https://github.com/labmlai/annotated_deep_learning_paper_implementations.git
synced 2025-08-15 10:11:39 +08:00
📊 tracker debug attention
This commit is contained in:
6
labml_nn/transformers/utils.py
Normal file
6
labml_nn/transformers/utils.py
Normal file
@ -0,0 +1,6 @@
|
||||
import torch
|
||||
|
||||
|
||||
def subsequent_mask(seq_len):
|
||||
mask = torch.tril(torch.ones(seq_len, seq_len)).to(torch.bool).unsqueeze(-1)
|
||||
return mask
|
Reference in New Issue
Block a user