Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
426b9623
Unverified
Commit
426b9623
authored
Feb 17, 2022
by
Gunjan Chhablani
Committed by
GitHub
Feb 17, 2022
Browse files
Fix shapes in model docstrings (#15696)
parent
92a537d9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
27 deletions
+27
-27
src/transformers/models/bart/modeling_bart.py
src/transformers/models/bart/modeling_bart.py
+9
-9
src/transformers/models/blenderbot_small/modeling_blenderbot_small.py
...mers/models/blenderbot_small/modeling_blenderbot_small.py
+9
-9
src/transformers/models/marian/modeling_marian.py
src/transformers/models/marian/modeling_marian.py
+9
-9
No files found.
src/transformers/models/bart/modeling_bart.py
View file @
426b9623
...
@@ -294,11 +294,11 @@ class BartEncoderLayer(nn.Module):
...
@@ -294,11 +294,11 @@ class BartEncoderLayer(nn.Module):
):
):
"""
"""
Args:
Args:
hidden_states (`torch.FloatTensor`): input to the layer of shape
*
(seq_len, batch, embed_dim)
*
hidden_states (`torch.FloatTensor`): input to the layer of shape
`
(seq_len, batch, embed_dim)
`
attention_mask (`torch.FloatTensor`): attention mask of size
attention_mask (`torch.FloatTensor`): attention mask of size
*
(batch, 1, tgt_len, src_len)
*
where padding elements are indicated by very large negative values.
`
(batch, 1, tgt_len, src_len)
`
where padding elements are indicated by very large negative values.
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
*
(encoder_attention_heads,)
*
.
`
(encoder_attention_heads,)
`
.
output_attentions (`bool`, *optional*):
output_attentions (`bool`, *optional*):
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
returned tensors for more detail.
returned tensors for more detail.
...
@@ -377,17 +377,17 @@ class BartDecoderLayer(nn.Module):
...
@@ -377,17 +377,17 @@ class BartDecoderLayer(nn.Module):
):
):
"""
"""
Args:
Args:
hidden_states (`torch.FloatTensor`): input to the layer of shape
*
(batch, seq_len, embed_dim)
*
hidden_states (`torch.FloatTensor`): input to the layer of shape
`
(batch, seq_len, embed_dim)
`
attention_mask (`torch.FloatTensor`): attention mask of size
attention_mask (`torch.FloatTensor`): attention mask of size
*
(batch, 1, tgt_len, src_len)
*
where padding elements are indicated by very large negative values.
`
(batch, 1, tgt_len, src_len)
`
where padding elements are indicated by very large negative values.
encoder_hidden_states (`torch.FloatTensor`):
encoder_hidden_states (`torch.FloatTensor`):
cross attention input to the layer of shape
*
(batch, seq_len, embed_dim)
*
cross attention input to the layer of shape
`
(batch, seq_len, embed_dim)
`
encoder_attention_mask (`torch.FloatTensor`): encoder attention mask of size
encoder_attention_mask (`torch.FloatTensor`): encoder attention mask of size
*
(batch, 1, tgt_len, src_len)
*
where padding elements are indicated by very large negative values.
`
(batch, 1, tgt_len, src_len)
`
where padding elements are indicated by very large negative values.
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
*
(encoder_attention_heads,)
*
.
`
(encoder_attention_heads,)
`
.
cross_attn_layer_head_mask (`torch.FloatTensor`): mask for cross-attention heads in a given layer of
cross_attn_layer_head_mask (`torch.FloatTensor`): mask for cross-attention heads in a given layer of
size
*
(decoder_attention_heads,)
*
.
size
`
(decoder_attention_heads,)
`
.
past_key_value (`Tuple(torch.FloatTensor)`): cached past key and value projection states
past_key_value (`Tuple(torch.FloatTensor)`): cached past key and value projection states
output_attentions (`bool`, *optional*):
output_attentions (`bool`, *optional*):
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
...
...
src/transformers/models/blenderbot_small/modeling_blenderbot_small.py
View file @
426b9623
...
@@ -295,11 +295,11 @@ class BlenderbotSmallEncoderLayer(nn.Module):
...
@@ -295,11 +295,11 @@ class BlenderbotSmallEncoderLayer(nn.Module):
):
):
"""
"""
Args:
Args:
hidden_states (`torch.FloatTensor`): input to the layer of shape
*
(seq_len, batch, embed_dim)
*
hidden_states (`torch.FloatTensor`): input to the layer of shape
`
(seq_len, batch, embed_dim)
`
attention_mask (`torch.FloatTensor`): attention mask of size
attention_mask (`torch.FloatTensor`): attention mask of size
*
(batch, 1, tgt_len, src_len)
*
where padding elements are indicated by very large negative values.
`
(batch, 1, tgt_len, src_len)
`
where padding elements are indicated by very large negative values.
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
*
(encoder_attention_heads,)
*
.
`
(encoder_attention_heads,)
`
.
output_attentions (`bool`, *optional*):
output_attentions (`bool`, *optional*):
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
returned tensors for more detail.
returned tensors for more detail.
...
@@ -379,17 +379,17 @@ class BlenderbotSmallDecoderLayer(nn.Module):
...
@@ -379,17 +379,17 @@ class BlenderbotSmallDecoderLayer(nn.Module):
):
):
"""
"""
Args:
Args:
hidden_states (`torch.FloatTensor`): input to the layer of shape
*
(batch, seq_len, embed_dim)
*
hidden_states (`torch.FloatTensor`): input to the layer of shape
`
(batch, seq_len, embed_dim)
`
attention_mask (`torch.FloatTensor`): attention mask of size
attention_mask (`torch.FloatTensor`): attention mask of size
*
(batch, 1, tgt_len, src_len)
*
where padding elements are indicated by very large negative values.
`
(batch, 1, tgt_len, src_len)
`
where padding elements are indicated by very large negative values.
encoder_hidden_states (`torch.FloatTensor`):
encoder_hidden_states (`torch.FloatTensor`):
cross attention input to the layer of shape
*
(batch, seq_len, embed_dim)
*
cross attention input to the layer of shape
`
(batch, seq_len, embed_dim)
`
encoder_attention_mask (`torch.FloatTensor`): encoder attention mask of size
encoder_attention_mask (`torch.FloatTensor`): encoder attention mask of size
*
(batch, 1, tgt_len, src_len)
*
where padding elements are indicated by very large negative values.
`
(batch, 1, tgt_len, src_len)
`
where padding elements are indicated by very large negative values.
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
*
(encoder_attention_heads,)
*
.
`
(encoder_attention_heads,)
`
.
cross_attn_layer_head_mask (`torch.FloatTensor`): mask for cross-attention heads in a given layer of
cross_attn_layer_head_mask (`torch.FloatTensor`): mask for cross-attention heads in a given layer of
size
*
(decoder_attention_heads,)
*
.
size
`
(decoder_attention_heads,)
`
.
past_key_value (`Tuple(torch.FloatTensor)`): cached past key and value projection states
past_key_value (`Tuple(torch.FloatTensor)`): cached past key and value projection states
output_attentions (`bool`, *optional*):
output_attentions (`bool`, *optional*):
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
...
...
src/transformers/models/marian/modeling_marian.py
View file @
426b9623
...
@@ -312,11 +312,11 @@ class MarianEncoderLayer(nn.Module):
...
@@ -312,11 +312,11 @@ class MarianEncoderLayer(nn.Module):
):
):
"""
"""
Args:
Args:
hidden_states (`torch.FloatTensor`): input to the layer of shape
*
(seq_len, batch, embed_dim)
*
hidden_states (`torch.FloatTensor`): input to the layer of shape
`
(seq_len, batch, embed_dim)
`
attention_mask (`torch.FloatTensor`): attention mask of size
attention_mask (`torch.FloatTensor`): attention mask of size
*
(batch, 1, tgt_len, src_len)
*
where padding elements are indicated by very large negative values.
`
(batch, 1, tgt_len, src_len)
`
where padding elements are indicated by very large negative values.
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
*
(encoder_attention_heads,)
*
.
`
(encoder_attention_heads,)
`
.
output_attentions (`bool`, *optional*):
output_attentions (`bool`, *optional*):
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
returned tensors for more detail.
returned tensors for more detail.
...
@@ -396,17 +396,17 @@ class MarianDecoderLayer(nn.Module):
...
@@ -396,17 +396,17 @@ class MarianDecoderLayer(nn.Module):
):
):
"""
"""
Args:
Args:
hidden_states (`torch.FloatTensor`): input to the layer of shape
*
(batch, seq_len, embed_dim)
*
hidden_states (`torch.FloatTensor`): input to the layer of shape
`
(batch, seq_len, embed_dim)
`
attention_mask (`torch.FloatTensor`): attention mask of size
attention_mask (`torch.FloatTensor`): attention mask of size
*
(batch, 1, tgt_len, src_len)
*
where padding elements are indicated by very large negative values.
`
(batch, 1, tgt_len, src_len)
`
where padding elements are indicated by very large negative values.
encoder_hidden_states (`torch.FloatTensor`):
encoder_hidden_states (`torch.FloatTensor`):
cross attention input to the layer of shape
*
(batch, seq_len, embed_dim)
*
cross attention input to the layer of shape
`
(batch, seq_len, embed_dim)
`
encoder_attention_mask (`torch.FloatTensor`): encoder attention mask of size
encoder_attention_mask (`torch.FloatTensor`): encoder attention mask of size
*
(batch, 1, tgt_len, src_len)
*
where padding elements are indicated by very large negative values.
`
(batch, 1, tgt_len, src_len)
`
where padding elements are indicated by very large negative values.
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
layer_head_mask (`torch.FloatTensor`): mask for attention heads in a given layer of size
*
(encoder_attention_heads,)
*
.
`
(encoder_attention_heads,)
`
.
cross_attn_layer_head_mask (`torch.FloatTensor`): mask for cross-attention heads in a given layer of
cross_attn_layer_head_mask (`torch.FloatTensor`): mask for cross-attention heads in a given layer of
size
*
(decoder_attention_heads,)
*
.
size
`
(decoder_attention_heads,)
`
.
past_key_value (`Tuple(torch.FloatTensor)`): cached past key and value projection states
past_key_value (`Tuple(torch.FloatTensor)`): cached past key and value projection states
output_attentions (`bool`, *optional*):
output_attentions (`bool`, *optional*):
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
Whether or not to return the attentions tensors of all attention layers. See `attentions` under
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment