Skip to content

Broken Documentation Strings for nn.MultiheadAttention #20023

@rmcavoy

Description

@rmcavoy

📚 Documentation

https://pytorch.org/docs/stable/nn.html?highlight=attention#torch.nn.MultiheadAttention

The docstring for the inputs and outputs of nn.MultiheadAttention are broken since they are in the wrong format. They also light on description of each input.

They display for inputs as,
query: [target length, batch size, embed dim] key: [sequence length, batch size, embed dim] value: [sequence length, batch size, embed dim] key_padding_mask: if True, mask padding based on batch size incremental_state: if provided, previous time steps are cashed need_weights: output attn_output_weights static_kv: key and value are static

and for outputs as.
attn_output: [target length, batch size, embed dim] attn_output_weights: [batch size, target length, sequence length]

Metadata

Metadata

Labels

high prioritymodule: docsRelated to our documentation, both in docs/ and docblockstriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions