Test the Transforms tutorial
Test the following tutorial: https://pytorch.org/tutorials/beginner/basics/transforms_tutorial.html Follow these steps:
- Fork the pytorch/tutorials repo.
- Switch to a new branch.
- Run the tutorial as a python script:
python3 <path-to-tutorial>
- Save the output into a .txt file. Did you see any errors? Add them to the output.
- Run the tutorial in the Google Colab and save the outputs into a .txt file. Did you see any issues? Take screenshots of the issues.
- Did the tutorial make sense? Can you suggest any improvements? Past all the outputs, screenshots, and suggestions for improvements in the issue and ping one of the reviewers. If your suggestion is approved, please submit a PR with the fix.
cc @svekars @kit1980
/assigntome
/assigntome
The issue is already assigned. Please pick an opened and unnasigned issue with the docathon-h1-2024 label.
Hi @svekars @kit1980 There was no issue while running this tutorial as python script and in Google colab. gcp_testing.txt local_testing.txt Updated_Documentation..txt May be we can explain the last part as
Updated Documentation Part
To represent categorical labels as one-hot encoded tensors, we start with an initial tensor array of zeros. For labels ranging from 1 to 10, the initial tensor array will be: torch.zeros(10, dtype=torch.float) will give [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0] Given a specific label for an image, say 3, the value 1.0 will be assigned to the corresponding index in the tensor array. Since indices start from 0, the label 3 will correspond to index 2. Thus, the final one-hot encoded tensor array will be: torch.zeros(10, dtype=torch.float).scatter_(dim=0, index=torch.tensor(y), value=1) will give [0.0,0.0,1.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
Hi, @subramen, do these suggestions for the Transforms tutorial sound good?
@saurabhkthakur maybe create a PR with the updated doc so people can see it and review?