spro / practical-pytorch

Go to https://github.com/pytorch/tutorials - this repo is deprecated and no longer maintained
MIT License
4.52k stars 1.11k forks source link

Update char-rnn-generation.ipynb #141

Open PatrikHolopainen opened 4 years ago

PatrikHolopainen commented 4 years ago

Changed the train() -function so that they work on PyTorch 1.3.1

Changed target[c] --> target[c].view(1) (because of dimensionality problems) Changed loss.data[0] --> loss.data.item()