[Doc] Fix rendering of the unicode characters (#134597)

https://github.com/pytorch/pytorch/pull/124771 introduced unicode escape sequences inside raw strings, which were not rendered correctly. Also fix typo in `\uue0 ` escape sequence (should have been `\u00e0`)
Fix it by relying on [string literal concatenation](https://docs.python.org/3/reference/lexical_analysis.html#string-literal-concatenation) to join raw and regular strings together during lexical analysis stage

Fixes https://github.com/pytorch/pytorch/issues/134422

Pull Request resolved: https://github.com/pytorch/pytorch/pull/134597
Approved by: https://github.com/aorenste, https://github.com/Skylion007
This commit is contained in:
Nikita Shulga
2024-08-27 19:52:44 +00:00
committed by PyTorch MergeBot
parent 3ef4c27ab3
commit 534f43ddce
3 changed files with 31 additions and 17 deletions

View File

@ -18,13 +18,13 @@ _ASMoutput = namedtuple("_ASMoutput", ["output", "loss"])
class AdaptiveLogSoftmaxWithLoss(Module):
r"""Efficient softmax approximation.
"""Efficient softmax approximation.
As described in
`Efficient softmax approximation for GPUs by Edouard Grave, Armand Joulin,
Moustapha Ciss\u00e9, David Grangier, and Herv\u00e9 J\u00e9gou
<https://arxiv.org/abs/1609.04309>`__.
""" r"""
Adaptive softmax is an approximate strategy for training models with large
output spaces. It is most effective when the label distribution is highly
imbalanced, for example in natural language modelling, where the word

View File

@ -241,11 +241,13 @@ class Conv1d(_ConvNd):
* :attr:`padding` controls the amount of padding applied to the input. It
can be either a string {{'valid', 'same'}} or a tuple of ints giving the
amount of implicit padding applied on both sides.
"""
"""
* :attr:`dilation` controls the spacing between the kernel points; also
known as the \uue0 trous algorithm. It is harder to describe, but this `link`_
known as the \u00e0 trous algorithm. It is harder to describe, but this `link`_
has a nice visualization of what :attr:`dilation` does.
"""
r"""
{groups_note}
Note:
@ -404,10 +406,13 @@ class Conv2d(_ConvNd):
* :attr:`padding` controls the amount of padding applied to the input. It
can be either a string {{'valid', 'same'}} or an int / a tuple of ints giving the
amount of implicit padding applied on both sides.
"""
"""
* :attr:`dilation` controls the spacing between the kernel points; also
known as the \u00e0 trous algorithm. It is harder to describe, but this `link`_
has a nice visualization of what :attr:`dilation` does.
"""
r"""
{groups_note}
@ -574,9 +579,12 @@ class Conv3d(_ConvNd):
* :attr:`padding` controls the amount of padding applied to the input. It
can be either a string {{'valid', 'same'}} or a tuple of ints giving the
amount of implicit padding applied on both sides.
"""
"""
* :attr:`dilation` controls the spacing between the kernel points; also known as the \u00e0 trous algorithm.
It is harder to describe, but this `link`_ has a nice visualization of what :attr:`dilation` does.
"""
r"""
{groups_note}
@ -834,10 +842,12 @@ class ConvTranspose1d(_ConvTransposeNd):
* :attr:`output_padding` controls the additional size added to one side
of the output shape. See note below for details.
"""
"""
* :attr:`dilation` controls the spacing between the kernel points; also known as the \u00e0 trous algorithm.
It is harder to describe, but the link `here`_ has a nice visualization of what :attr:`dilation` does.
"""
r"""
{groups_note}
Note:
@ -996,10 +1006,12 @@ class ConvTranspose2d(_ConvTransposeNd):
* :attr:`output_padding` controls the additional size added to one side
of the output shape. See note below for details.
"""
"""
* :attr:`dilation` controls the spacing between the kernel points; also known as the \u00e0 trous algorithm.
It is harder to describe, but the link `here`_ has a nice visualization of what :attr:`dilation` does.
"""
r"""
{groups_note}
The parameters :attr:`kernel_size`, :attr:`stride`, :attr:`padding`, :attr:`output_padding`
@ -1184,10 +1196,12 @@ class ConvTranspose3d(_ConvTransposeNd):
* :attr:`output_padding` controls the additional size added to one side
of the output shape. See note below for details.
"""
"""
* :attr:`dilation` controls the spacing between the kernel points; also known as the \u00e0 trous algorithm.
It is harder to describe, but the link `here`_ has a nice visualization of what :attr:`dilation` does.
"""
r"""
{groups_note}
The parameters :attr:`kernel_size`, :attr:`stride`, :attr:`padding`, :attr:`output_padding`

View File

@ -42,10 +42,10 @@ class Fold(Module):
* :attr:`padding` controls the amount of implicit zero-paddings on both
sides for :attr:`padding` number of points for each dimension before
reshaping.
""" """
* :attr:`dilation` controls the spacing between the kernel points; also known as the \u00e0 trous algorithm.
It is harder to describe, but this `link`_ has a nice visualization of what :attr:`dilation` does.
""" r"""
Args:
output_size (int or tuple): the shape of the spatial dimensions of the
output (i.e., ``output.sizes()[2:]``)
@ -194,10 +194,10 @@ class Unfold(Module):
* :attr:`padding` controls the amount of implicit zero-paddings on both
sides for :attr:`padding` number of points for each dimension before
reshaping.
""" """
* :attr:`dilation` controls the spacing between the kernel points; also known as the \u00e0 trous algorithm.
It is harder to describe, but this `link`_ has a nice visualization of what :attr:`dilation` does.
""" r"""
Args:
kernel_size (int or tuple): the size of the sliding blocks
dilation (int or tuple, optional): a parameter that controls the