Skip to content

Commit c08519b

Browse files
Convert docstring to literal and fix math rendering typo (#1739)
Co-authored-by: soulitzer <jw3468@fb.com>
1 parent a04723d commit c08519b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

beginner_source/examples_autograd/polynomial_autograd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-------------------------------
55
66
A third order polynomial, trained to predict :math:`y=\sin(x)` from :math:`-\pi`
7-
to :math:`pi` by minimizing squared Euclidean distance.
7+
to :math:`\pi` by minimizing squared Euclidean distance.
88
99
This implementation computes the forward pass using operations on PyTorch
1010
Tensors, and uses PyTorch autograd to compute gradients.

beginner_source/examples_autograd/polynomial_custom_function.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# -*- coding: utf-8 -*-
2-
"""
2+
r"""
33
PyTorch: Defining New autograd Functions
44
----------------------------------------
55
66
A third order polynomial, trained to predict :math:`y=\sin(x)` from :math:`-\pi`
7-
to :math:`pi` by minimizing squared Euclidean distance. Instead of writing the
7+
to :math:`\pi` by minimizing squared Euclidean distance. Instead of writing the
88
polynomial as :math:`y=a+bx+cx^2+dx^3`, we write the polynomial as
99
:math:`y=a+b P_3(c+dx)` where :math:`P_3(x)=\frac{1}{2}\left(5x^3-3x\right)` is
1010
the `Legendre polynomial`_ of degree three.

0 commit comments

Comments
 (0)