Skip to content

Commit 5a46cd0

Browse files
author
Svetlana Karslioglu
authored
Merge branch 'master' into distr-tutorial-landing
2 parents 248324a + 0452dd8 commit 5a46cd0

File tree

7 files changed

+24
-11
lines changed

7 files changed

+24
-11
lines changed

.jenkins/validate_tutorials_built.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"forward_ad_usage",
2626
"parametrizations",
2727
"reinforcement_q_learning",
28-
"text_to_speech_with_torchaudio",
2928
"mnist_train_nas", # used by ax_multiobjective_nas_tutorial.py
3029
"fx_conv_bn_fuser",
3130
"super_resolution_with_onnxruntime",

beginner_source/basics/optimization_tutorial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from torch import nn
2929
from torch.utils.data import DataLoader
3030
from torchvision import datasets
31-
from torchvision.transforms import ToTensor, Lambda
31+
from torchvision.transforms import ToTensor
3232

3333
training_data = datasets.FashionMNIST(
3434
root="data",

beginner_source/ddp_series_multigpu.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,18 @@ Distributing input data
123123
+ sampler=DistributedSampler(train_dataset),
124124
)
125125
126+
- Calling the ``set_epoch()`` method on the ``DistributedSampler`` at the beginning of each epoch is necessary to make shuffling work
127+
properly across multiple epochs. Otherwise, the same ordering will be used in each epoch.
128+
129+
.. code:: diff
130+
131+
def _run_epoch(self, epoch):
132+
b_sz = len(next(iter(self.train_data))[0])
133+
+ self.train_data.sampler.set_epoch(epoch)
134+
for source, targets in self.train_data:
135+
...
136+
self._run_batch(source, targets)
137+
126138
127139
Saving model checkpoints
128140
~~~~~~~~~~~~~~~~~~~~~~~~

beginner_source/introyt/autogradyt_tutorial.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
###########################################################################
4242
# A machine learning model is a *function*, with inputs and outputs. For
43-
# this discussion, we’ll treat the inputs a as an *i*-dimensional vector
43+
# this discussion, we’ll treat the inputs as an *i*-dimensional vector
4444
# :math:`\vec{x}`, with elements :math:`x_{i}`. We can then express the
4545
# model, *M*, as a vector-valued function of the input: :math:`\vec{y} =
4646
# \vec{M}(\vec{x})`. (We treat the value of M’s output as
@@ -226,7 +226,7 @@
226226
# of which should be :math:`2 * cos(a)`. Looking at the graph above,
227227
# that’s just what we see.
228228
#
229-
# Be aware than only *leaf nodes* of the computation have their gradients
229+
# Be aware that only *leaf nodes* of the computation have their gradients
230230
# computed. If you tried, for example, ``print(c.grad)`` you’d get back
231231
# ``None``. In this simple example, only the input is a leaf node, so only
232232
# it has gradients computed.

conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
'gallery_dirs': ['beginner', 'intermediate', 'advanced', 'recipes', 'prototype'],
9090
'filename_pattern': '.py',
9191
'ignore_pattern': re.compile(f"({'|'.join(NOT_RUN)}).py$"),
92+
'promote_jupyter_magic': True,
9293
'backreferences_dir': None
9394
}
9495

@@ -140,9 +141,9 @@
140141
# built documents.
141142
#
142143
# The short X.Y version.
143-
version = torch.__version__
144+
version = str(torch.__version__)
144145
# The full version, including alpha/beta/rc tags.
145-
release = torch.__version__
146+
release = str(torch.__version__)
146147

147148
# The language for content autogenerated by Sphinx. Refer to documentation
148149
# for a list of supported languages.

intermediate_source/text_to_speech_with_torchaudio.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
88
"""
99

10-
# %matplotlib inline
11-
12-
1310
######################################################################
1411
# Overview
1512
# --------
@@ -52,8 +49,11 @@
5249
# encoding.
5350
#
5451

55-
# When running this example in notebook, install DeepPhonemizer
56-
# !pip3 install deep_phonemizer
52+
# %%
53+
# .. code-block:: bash
54+
#
55+
# %%bash
56+
# pip3 install deep_phonemizer
5757

5858
import torch
5959
import torchaudio

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pytorch-lightning
2727
torchx
2828
ax-platform
2929
nbformat>=4.2.0
30+
deep_phonemizer==0.0.17
3031

3132
# PyTorch Theme
3233
-e git+https://github.com/pytorch/pytorch_sphinx_theme.git#egg=pytorch_sphinx_theme

0 commit comments

Comments
 (0)