Skip to content

modified loss as per new pytorch version#15

Open
vganesh46 wants to merge 1 commit intocs230-stanford:masterfrom
vganesh46:pytorch-new-loss
Open

modified loss as per new pytorch version#15
vganesh46 wants to merge 1 commit intocs230-stanford:masterfrom
vganesh46:pytorch-new-loss

Conversation

@vganesh46
Copy link
Copy Markdown

Before Pytorch 0.4.0., loss was a Variable wrapping a tensor of size (1,), but in 0.4.0 loss is now a scalar and has 0 dimensions. Indexing into a scalar doesn’t make sense (it gives a warning now, but will be a hard error in 0.5.0). Use loss.item() to get the Python number from a scalar.

https://pytorch.org/blog/pytorch-0_4_0-migration-guide/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant