Skip to content

Commit 30ef99c

Browse files
authored
Merge branch 'main' into fix/3855-deprecated-inplace-ops
2 parents b422272 + 5b38f5a commit 30ef99c

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

.ci/docker/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pydantic>=2.10
2525
fastapi
2626
matplotlib
2727
librosa
28-
torch==2.11
28+
torch==2.12
2929
torchvision
3030
torchdata
3131
networkx

advanced_source/privateuseone.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Facilitating New Backend Integration by PrivateUse1
44
In this tutorial we will walk through some necessary steps to integrate a new backend
55
living outside ``pytorch/pytorch`` repo by ``PrivateUse1``. Note that this tutorial assumes that
66
you already have a basic understanding of PyTorch.
7-
you are an advanced user of PyTorch.
87

98
.. note::
109

beginner_source/blitz/tensor_tutorial.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@
105105
#
106106

107107
# We move our tensor to the GPU if available
108-
if torch.cuda.is_available():
109-
tensor = tensor.to('cuda')
110-
print(f"Device tensor is stored on: {tensor.device}")
108+
device = torch.accelerator.current_accelerator().type if torch.accelerator.is_available() else 'cpu'
109+
tensor = tensor.to(device)
110+
print(f"Device tensor is stored on: {tensor.device}")
111111

112112

113113
######################################################################

beginner_source/ddp_series_multigpu.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ Running the distributed training job
202202
Here's what the code looks like:
203203

204204
.. code-block:: python
205+
205206
def main(rank, world_size, total_epochs, save_every):
206207
ddp_setup(rank, world_size)
207208
dataset, model, optimizer = load_train_objs()
@@ -218,7 +219,6 @@ Here's what the code looks like:
218219
mp.spawn(main, args=(world_size, total_epochs, save_every,), nprocs=world_size)
219220
220221
221-
222222
Further Reading
223223
---------------
224224

beginner_source/introyt/modelsyt_tutorial.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ class is a subclass of ``torch.Tensor``, with the special behavior that
4848
class TinyModel(torch.nn.Module):
4949

5050
def __init__(self):
51-
super(TinyModel, self).__init__()
51+
super().__init__()
5252

5353
self.linear1 = torch.nn.Linear(100, 200)
5454
self.activation = torch.nn.ReLU()
5555
self.linear2 = torch.nn.Linear(200, 10)
56-
self.softmax = torch.nn.Softmax()
56+
self.softmax = torch.nn.Softmax(dim=1)
5757

5858
def forward(self, x):
5959
x = self.linear1(x)
@@ -150,7 +150,7 @@ def forward(self, x):
150150
class LeNet(torch.nn.Module):
151151

152152
def __init__(self):
153-
super(LeNet, self).__init__()
153+
super().__init__()
154154
# 1 input image channel (black & white), 6 output channels, 5x5 square convolution
155155
# kernel
156156
self.conv1 = torch.nn.Conv2d(1, 6, 5)
@@ -249,7 +249,7 @@ def num_flat_features(self, x):
249249
class LSTMTagger(torch.nn.Module):
250250

251251
def __init__(self, embedding_dim, hidden_dim, vocab_size, tagset_size):
252-
super(LSTMTagger, self).__init__()
252+
super().__init__()
253253
self.hidden_dim = hidden_dim
254254

255255
self.word_embeddings = torch.nn.Embedding(vocab_size, embedding_dim)

index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Welcome to PyTorch Tutorials
33

44
**What's new in PyTorch tutorials?**
55

6+
* `Data Loading Optimization in PyTorch <https://docs.pytorch.org/tutorials/intermediate/intermediate_data_loading_tutorial.html>`__
67
* `Distributed Training with Ray Train <https://docs.pytorch.org/tutorials/beginner/distributed_training_with_ray_tutorial.html>`__
78
* `Serve PyTorch models at scale with Ray Serve <https://docs.pytorch.org/tutorials/beginner/serving_tutorial.html>`__
89
* `Hyperparameter tuning using Ray Tune <https://docs.pytorch.org/tutorials/beginner/hyperparameter_tuning_tutorial.html>`__

0 commit comments

Comments
 (0)