fastai / course-v3

The 3rd edition of course.fast.ai
https://course.fast.ai/
Apache License 2.0
4.9k stars 3.55k forks source link

Fixed cannnot call numpy on variable that requires grad error #497

Closed Priyansi closed 4 years ago

Priyansi commented 4 years ago

In lesson2-sgd, an error pops up, specifically, cannot call numpy on variable that requires grad. I have included a simple fix by changing x@a to x@a.detach().numpy(). This solves the error.

review-notebook-app[bot] commented 4 years ago

Check out this pull request on  ReviewNB

You'll be able to see Jupyter notebook diff and discuss changes. Powered by ReviewNB.

Priyansi commented 4 years ago

Can you please tell me why this failed?