Skip to content

Conversation

@sorenrasmussenai
Copy link
Contributor

@sorenrasmussenai sorenrasmussenai commented Feb 2, 2019

Fixes #16364


if self.is_better(current, self.best):
self.best = current
if isinstance(current, torch.Tensor):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't current supposed to be a scalar?
If yes, can't you do something like

self.best = float(current)

?

@ezyang
Copy link
Contributor

ezyang commented Feb 10, 2019

Needs a test

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@soumith is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@soumith merged this pull request in 95d3825.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReduceLROnPlateau should clone "current" when saving "best"

5 participants