From d97e9d171c878efd6fcab4d87afac8f35a21ed74 Mon Sep 17 00:00:00 2001 From: Lysandre Date: Tue, 27 Oct 2020 08:10:06 -0400 Subject: [PATCH] Fix DeBERTa docs --- src/transformers/modeling_deberta.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/transformers/modeling_deberta.py b/src/transformers/modeling_deberta.py index 060e762f9f0c59..a5558f31ea9f28 100644 --- a/src/transformers/modeling_deberta.py +++ b/src/transformers/modeling_deberta.py @@ -797,13 +797,18 @@ def _init_weights(self, module): `What are input IDs? <../glossary.html#input-ids>`__ attention_mask (:obj:`torch.FloatTensor` of shape :obj:`{0}`, `optional`): - Mask to avoid performing attention on padding token indices. Mask values selected in ``[0, 1]``: ``1`` for - tokens that are NOT MASKED, ``0`` for MASKED tokens. + Mask to avoid performing attention on padding token indices. Mask values selected in ``[0, 1]``: + + - 1 for tokens that are **not masked**, + - 0 for tokens that are **masked**. `What are attention masks? <../glossary.html#attention-mask>`__ token_type_ids (:obj:`torch.LongTensor` of shape :obj:`{0}`, `optional`): Segment token indices to indicate first and second portions of the inputs. Indices are selected in ``[0, - 1]``: ``0`` corresponds to a `sentence A` token, ``1`` corresponds to a `sentence B` token + 1]``: + + - 0 corresponds to a `sentence A` token, + - 1 corresponds to a `sentence B` token. `What are token type IDs? <../glossary.html#token-type-ids>`_ position_ids (:obj:`torch.LongTensor` of shape :obj:`{0}`, `optional`): @@ -816,14 +821,13 @@ def _init_weights(self, module): This is useful if you want more control over how to convert `input_ids` indices into associated vectors than the model's internal embedding lookup matrix. output_attentions (:obj:`bool`, `optional`): - If set to ``True``, the attentions tensors of all attention layers are returned. See ``attentions`` under - returned tensors for more detail. - output_hidden_states (:obj:`bool`, `optional`): - If set to ``True``, the hidden states of all layers are returned. See ``hidden_states`` under returned + Whether or not to return the attentions tensors of all attention layers. See ``attentions`` under returned tensors for more detail. + output_hidden_states (:obj:`bool`, `optional`): + Whether or not to return the hidden states of all layers. See ``hidden_states`` under returned tensors for + more detail. return_dict (:obj:`bool`, `optional`): - If set to ``True``, the model will return a :class:`~transformers.file_utils.ModelOutput` instead of a - plain tuple. + Whether or not to return a :class:`~transformers.file_utils.ModelOutput` instead of a plain tuple. """