Skip to content

Commit 7f52575

Browse files
authored
Merge branch 'main' into splion-360/rl-dqn-fixes
2 parents 8677557 + 06f9c4b commit 7f52575

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

beginner_source/introyt/introyt1_tutorial.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -303,22 +303,21 @@ def num_flat_features(self, x):
303303
# The values passed to the transform are the means (first tuple) and the
304304
# standard deviations (second tuple) of the rgb values of the images in
305305
# the dataset. You can calculate these values yourself by running these
306-
# few lines of code:
307-
# ```
308-
# from torch.utils.data import ConcatDataset
309-
# transform = transforms.Compose([transforms.ToTensor()])
310-
# trainset = torchvision.datasets.CIFAR10(root='./data', train=True,
306+
# few lines of code::
307+
#
308+
# from torch.utils.data import ConcatDataset
309+
# transform = transforms.Compose([transforms.ToTensor()])
310+
# trainset = torchvision.datasets.CIFAR10(root='./data', train=True,
311311
# download=True, transform=transform)
312312
#
313-
# #stack all train images together into a tensor of shape
314-
# #(50000, 3, 32, 32)
315-
# x = torch.stack([sample[0] for sample in ConcatDataset([trainset])])
313+
# # stack all train images together into a tensor of shape
314+
# # (50000, 3, 32, 32)
315+
# x = torch.stack([sample[0] for sample in ConcatDataset([trainset])])
316316
#
317-
# #get the mean of each channel
318-
# mean = torch.mean(x, dim=(0,2,3)) #tensor([0.4914, 0.4822, 0.4465])
319-
# std = torch.std(x, dim=(0,2,3)) #tensor([0.2470, 0.2435, 0.2616])
320-
#
321-
# ```
317+
# # get the mean of each channel
318+
# mean = torch.mean(x, dim=(0,2,3)) # tensor([0.4914, 0.4822, 0.4465])
319+
# std = torch.std(x, dim=(0,2,3)) # tensor([0.2470, 0.2435, 0.2616])
320+
#
322321
#
323322
# There are many more transforms available, including cropping, centering,
324323
# rotation, and reflection.

intermediate_source/ddp_tutorial.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ Let's still use the Toymodel example and create a file named ``elastic_ddp.py``.
311311

312312
.. code:: python
313313
314+
import os
314315
import torch
315316
import torch.distributed as dist
316317
import torch.nn as nn

intermediate_source/flask_rest_api_tutorial.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,7 @@ def get_prediction(image_bytes):
321321
# for deploying a Flask server in production.
322322
#
323323
# - You can also add a UI by creating a page with a form which takes the image and
324-
# displays the prediction. Check out the `demo <https://pytorch-imagenet.herokuapp.com/>`_
325-
# of a similar project and its `source code <https://github.com/avinassh/pytorch-flask-api-heroku>`_.
326-
#
324+
# displays the prediction.
327325
# - In this tutorial, we only showed how to build a service that could return predictions for
328326
# a single image at a time. We could modify our service to be able to return predictions for
329327
# multiple images at once. In addition, the `service-streamer <https://github.com/ShannonAI/service-streamer>`_

0 commit comments

Comments
 (0)