Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Fixed 2 errors #144

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fixed 2 errors #144

wants to merge 2 commits into from

Conversation

tc-ha
Copy link

@tc-ha tc-ha commented May 10, 2020

the detail of how and what I fixed is in the commits

tc-ha added 2 commits May 10, 2020 15:25
Fixed the following: "IndexError: dimension specified as 0 but tensor has no dimensions"
loss.data is now a 0-dim tensor it can't have elements. so loss.data[0] won't work. 
what he meant by loss.data[0] is a scalar of loss (a single value of loss). we can get the value by using loss.item() which throw out a single value of loss
so I replaced loss.data[0] with loss.item() and it works
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant