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
d1d3ac94
Unverified
Commit
d1d3ac94
authored
Dec 20, 2022
by
Sanchit Gandhi
Committed by
GitHub
Dec 20, 2022
Browse files
[mBART] fix erroneous italics in docstring (#20835)
* [mBART] fix erroneous italics in docstring * fix-copies
parent
244dd0f1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
48 deletions
+48
-48
src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
...ormers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
+6
-6
src/transformers/models/blenderbot/modeling_blenderbot.py
src/transformers/models/blenderbot/modeling_blenderbot.py
+9
-9
src/transformers/models/m2m_100/modeling_m2m_100.py
src/transformers/models/m2m_100/modeling_m2m_100.py
+9
-9
src/transformers/models/mbart/modeling_mbart.py
src/transformers/models/mbart/modeling_mbart.py
+9
-9
src/transformers/models/pegasus/modeling_pegasus.py
src/transformers/models/pegasus/modeling_pegasus.py
+9
-9
src/transformers/models/xglm/modeling_xglm.py
src/transformers/models/xglm/modeling_xglm.py
+6
-6
No files found.
src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
View file @
d1d3ac94
...
@@ -1497,17 +1497,17 @@ class BigBirdPegasusDecoderLayer(nn.Module):
...
@@ -1497,17 +1497,17 @@ class BigBirdPegasusDecoderLayer(nn.Module):
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""
"""
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.
encoder_hidden_states (`torch.FloatTensor`):
encoder_hidden_states (`torch.FloatTensor`):
cross attention input to the layer of shape
*
(seq_len, batch, embed_dim)
*
cross attention input to the layer of shape
`
(seq_len, batch, 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/modeling_blenderbot.py
View file @
d1d3ac94
...
@@ -307,11 +307,11 @@ class BlenderbotEncoderLayer(nn.Module):
...
@@ -307,11 +307,11 @@ class BlenderbotEncoderLayer(nn.Module):
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""
"""
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.
...
@@ -391,17 +391,17 @@ class BlenderbotDecoderLayer(nn.Module):
...
@@ -391,17 +391,17 @@ class BlenderbotDecoderLayer(nn.Module):
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""
"""
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.
encoder_hidden_states (`torch.FloatTensor`):
encoder_hidden_states (`torch.FloatTensor`):
cross attention input to the layer of shape
*
(seq_len, batch, embed_dim)
*
cross attention input to the layer of shape
`
(seq_len, batch, 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/m2m_100/modeling_m2m_100.py
View file @
d1d3ac94
...
@@ -375,11 +375,11 @@ class M2M100EncoderLayer(nn.Module):
...
@@ -375,11 +375,11 @@ class M2M100EncoderLayer(nn.Module):
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""
"""
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.
...
@@ -459,17 +459,17 @@ class M2M100DecoderLayer(nn.Module):
...
@@ -459,17 +459,17 @@ class M2M100DecoderLayer(nn.Module):
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""
"""
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.
encoder_hidden_states (`torch.FloatTensor`):
encoder_hidden_states (`torch.FloatTensor`):
cross attention input to the layer of shape
*
(seq_len, batch, embed_dim)
*
cross attention input to the layer of shape
`
(seq_len, batch, 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/mbart/modeling_mbart.py
View file @
d1d3ac94
...
@@ -326,11 +326,11 @@ class MBartEncoderLayer(nn.Module):
...
@@ -326,11 +326,11 @@ class MBartEncoderLayer(nn.Module):
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""
"""
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.
...
@@ -409,17 +409,17 @@ class MBartDecoderLayer(nn.Module):
...
@@ -409,17 +409,17 @@ class MBartDecoderLayer(nn.Module):
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""
"""
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.
encoder_hidden_states (`torch.FloatTensor`):
encoder_hidden_states (`torch.FloatTensor`):
cross attention input to the layer of shape
*
(seq_len, batch, embed_dim)
*
cross attention input to the layer of shape
`
(seq_len, batch, 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/pegasus/modeling_pegasus.py
View file @
d1d3ac94
...
@@ -322,11 +322,11 @@ class PegasusEncoderLayer(nn.Module):
...
@@ -322,11 +322,11 @@ class PegasusEncoderLayer(nn.Module):
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""
"""
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.
...
@@ -406,17 +406,17 @@ class PegasusDecoderLayer(nn.Module):
...
@@ -406,17 +406,17 @@ class PegasusDecoderLayer(nn.Module):
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""
"""
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.
encoder_hidden_states (`torch.FloatTensor`):
encoder_hidden_states (`torch.FloatTensor`):
cross attention input to the layer of shape
*
(seq_len, batch, embed_dim)
*
cross attention input to the layer of shape
`
(seq_len, batch, 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/xglm/modeling_xglm.py
View file @
d1d3ac94
...
@@ -431,17 +431,17 @@ class XGLMDecoderLayer(nn.Module):
...
@@ -431,17 +431,17 @@ class XGLMDecoderLayer(nn.Module):
)
->
torch
.
Tensor
:
)
->
torch
.
Tensor
:
"""
"""
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.
encoder_hidden_states (`torch.FloatTensor`):
encoder_hidden_states (`torch.FloatTensor`):
cross attention input to the layer of shape
*
(seq_len, batch, embed_dim)
*
cross attention input to the layer of shape
`
(seq_len, batch, 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