Skip to content

Commit

Permalink
Update return introduction (huggingface#11976)
Browse files Browse the repository at this point in the history
Make it clear that the `forward` method now returns a dict instead of tuple.

Fix style
  • Loading branch information
kouyk authored and Iwontbecreative committed Jul 15, 2021
1 parent 4501d9c commit e5b00f7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/transformers/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,18 +613,18 @@ def docstring_decorator(fn):

PT_RETURN_INTRODUCTION = r"""
Returns:
:class:`~{full_output_type}` or :obj:`tuple(torch.FloatTensor)`: A :class:`~{full_output_type}` (if
``return_dict=True`` is passed or when ``config.return_dict=True``) or a tuple of :obj:`torch.FloatTensor`
comprising various elements depending on the configuration (:class:`~transformers.{config_class}`) and inputs.
:class:`~{full_output_type}` or :obj:`tuple(torch.FloatTensor)`: A :class:`~{full_output_type}` or a tuple of
:obj:`torch.FloatTensor` (if ``return_dict=False`` is passed or when ``config.return_dict=False``) comprising
various elements depending on the configuration (:class:`~transformers.{config_class}`) and inputs.
"""


TF_RETURN_INTRODUCTION = r"""
Returns:
:class:`~{full_output_type}` or :obj:`tuple(tf.Tensor)`: A :class:`~{full_output_type}` (if
``return_dict=True`` is passed or when ``config.return_dict=True``) or a tuple of :obj:`tf.Tensor` comprising
various elements depending on the configuration (:class:`~transformers.{config_class}`) and inputs.
:class:`~{full_output_type}` or :obj:`tuple(tf.Tensor)`: A :class:`~{full_output_type}` or a tuple of
:obj:`tf.Tensor` (if ``return_dict=False`` is passed or when ``config.return_dict=False``) comprising various
elements depending on the configuration (:class:`~transformers.{config_class}`) and inputs.
"""

Expand Down

0 comments on commit e5b00f7

Please sign in to comment.