Commit 7939159
Fixes #1983
Moved input to device on line `234` instead of `232` for readability.
`y` on line `232` can't be moved to device due to being an `int`
I've found out about this issue while following the tutorial from Quickstart and reaching "Optimization model parameters". I was iterating on the code started on Quickstart and the model had been sent to the device. [Optimization tutorial] (https://github.com/pytorch/tutorials/blob/main/beginner_source/basics/optimization_tutorial.py) doesn't move the model or input to the device and this is when I got the error described in #1983.
In light of this, should optimization_tutorial.py also be updated?
Test plan:
* Tested in Colab using GPU, [link](https://colab.research.google.com/drive/1X7BJHd42FN9N_8DiXd7h4ScplN2-OmLo?usp=sharing)
Co-authored-by: Svetlana Karslioglu <[email protected]>
1 parent 7a9632a commit 7939159
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
218 | | - | |
| 218 | + | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
240 | 241 | | |
241 | 242 | | |
242 | 243 | | |
| |||
0 commit comments