Skip to content

Conversation

@lematt1991
Copy link

This ensures that we are returning results of the same type in LBFGS step. Assuming the closure returns a tensor (which we do here), we could potentially return either a float or a Tensor. This PR makes the return type uniform.

This ensures that we are returning results of the same type
in LBFGS step.
@ezyang
Copy link
Contributor

ezyang commented May 15, 2018

Is there a test we can add for this?

Sets the tolerance_grad to negative infinity and positive
infinity to deterministically excercise the early exit branch
@ezyang ezyang merged commit c5b9a36 into pytorch:master May 16, 2018
@lematt1991 lematt1991 deleted the lbfgs-ret-same-type branch May 16, 2018 15:18
weiyangfb pushed a commit to weiyangfb/pytorch that referenced this pull request Jun 11, 2018
* Make return uniform in lbfgs step

This ensures that we are returning results of the same type
in LBFGS step.

* Adding test case to exercise different exit points

Sets the tolerance_grad to negative infinity and positive
infinity to deterministically excercise the early exit branch

* Fixing lint error
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.

2 participants