Skip to content

Minor style bug: remove backticks in the section of code #2814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Satyamkhadka opened this issue Mar 28, 2024 · 1 comment · Fixed by #3381
Closed

Minor style bug: remove backticks in the section of code #2814

Satyamkhadka opened this issue Mar 28, 2024 · 1 comment · Fixed by #3381
Assignees
Labels
docathon-h1-2025 A label for the docathon in H1 2025 easy website Issues related to website rendering

Comments

@Satyamkhadka
Copy link
Contributor

Satyamkhadka commented Mar 28, 2024

On this page => https://pytorch.org/tutorials/beginner/introyt/introyt1_tutorial.html
in Datasets and Dataloaders section,

[Expected Result]

from torch.utils.data 
import ConcatDataset 
transform = transforms.Compose([transforms.ToTensor()]) 
trainset = torchvision.datasets.CIFAR10(root=’./data’, train=True,download=True, transform=transform)

#stack all train images together into a tensor of shape 
#(50000, 3, 32, 32) 
x = torch.stack([sample[0] for sample in ConcatDataset([trainset])])

#get the mean of each channel 
mean = torch.mean(x, dim=(0,2,3)) #tensor([0.4914, 0.4822, 0.4465]) 
std = torch.std(x, dim=(0,2,3)) #tensor([0.2470, 0.2435, 0.2616])

[ACTUAL RESULT]
```
from torch.utils.data
import ConcatDataset
transform = transforms.Compose([transforms.ToTensor()])
trainset = torchvision.datasets.CIFAR10(root=’./data’, train=True,download=True, transform=transform)

#stack all train images together into a tensor of shape
#(50000, 3, 32, 32)
x = torch.stack([sample[0] for sample in ConcatDataset([trainset])])

#get the mean of each channel
mean = torch.mean(x, dim=(0,2,3)) #tensor([0.4914, 0.4822, 0.4465])
std = torch.std(x, dim=(0,2,3)) #tensor([0.2470, 0.2435, 0.2616])
```

cc @svekars @sekyondaMeta @AlannaBurke

Satyamkhadka added a commit to Satyamkhadka/tutorials that referenced this issue Mar 28, 2024
removed commented code block and backticks
@svekars svekars added the website Issues related to website rendering label May 29, 2025
@sekyondaMeta sekyondaMeta added easy docathon-h1-2025 A label for the docathon in H1 2025 labels Jun 3, 2025
@Rachel0619
Copy link
Contributor

/assigntome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docathon-h1-2025 A label for the docathon in H1 2025 easy website Issues related to website rendering
Projects
None yet
4 participants