Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion torch/nn/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -3126,7 +3126,7 @@ def multi_head_attention_forward(query, # type: Tensor
- value: :math:`(S, N, E)` where S is the source sequence length, N is the batch size, E is
the embedding dimension.
- key_padding_mask: :math:`(N, S)`, ByteTensor, where N is the batch size, S is the source sequence length.
- attn_mask: :math:`(L, L)` where L is the target sequence length.
- attn_mask: :math:`(L, S)` where L is the target sequence length, S is the source sequence length.

Outputs:
- attn_output: :math:`(L, N, E)` where L is the target sequence length, N is the batch size,
Expand Down
2 changes: 1 addition & 1 deletion torch/nn/modules/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,7 @@ def forward(self, query, key, value, key_padding_mask=None,
- value: :math:`(S, N, E)` where S is the source sequence length, N is the batch size, E is
the embedding dimension.
- key_padding_mask: :math:`(N, S)`, ByteTensor, where N is the batch size, S is the source sequence length.
- attn_mask: :math:`(L, L)` where L is the target sequence length.
- attn_mask: :math:`(L, S)` where L is the target sequence length, S is the source sequence length.

- Outputs:
- attn_output: :math:`(L, N, E)` where L is the target sequence length, N is the batch size,
Expand Down