Skip to content

fix_StackOverFlow_Case6 #50427

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from

Conversation

enkilee
Copy link
Contributor

@enkilee enkilee commented Feb 10, 2023

PR types

Bug fixes

PR changes

OPs

Describe

Solution

Cause original code compare the input x dims size is equal to it's self.
but in code ,when x and y all input x . if x dim is [1,1] ,y is [1], is not equal .
So delete this code. Add code to judge y dim.

@paddle-bot
Copy link

paddle-bot bot commented Feb 10, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

麻烦把case加到单测里吧~

@enkilee
Copy link
Contributor Author

enkilee commented Feb 14, 2023

麻烦把case加到单测里吧~

您好,我看了下test_lbfgs.py,发现有单测,用的dot,dot的单测里已有对输入X和Y的测试

@wanghuancoder
Copy link
Contributor

麻烦把case加到单测里吧~

您好,我看了下test_lbfgs.py,发现有单测,用的dot,dot的单测里已有对输入X和Y的测试

我是说把这个case加到单测中,一方面证明这个PR的修改能够修复这个case。另一方面也对这种场景加以保护。

import paddle
import numpy as np
array = np.array([2.4], dtype=np.float32)
x = paddle.to_tensor(np.reshape(array, [1, 1]), dtype='float32')
layer = paddle.incubate.optimizer.functional.minimize_lbfgs(
    lambda x: paddle.dot(x, x), initial_position=x, tolerance_grad=0.0, initial_inverse_hessian_estimate=x)

@enkilee
Copy link
Contributor Author

enkilee commented Feb 14, 2023

麻烦把case加到单测里吧~

您好,我看了下test_lbfgs.py,发现有单测,用的dot,dot的单测里已有对输入X和Y的测试

我是说把这个case加到单测中,一方面证明这个PR的修改能够修复这个case。另一方面也对这种场景加以保护。

import paddle
import numpy as np
array = np.array([2.4], dtype=np.float32)
x = paddle.to_tensor(np.reshape(array, [1, 1]), dtype='float32')
layer = paddle.incubate.optimizer.functional.minimize_lbfgs(
    lambda x: paddle.dot(x, x), initial_position=x, tolerance_grad=0.0, initial_inverse_hessian_estimate=x)

收到!

@enkilee
Copy link
Contributor Author

enkilee commented Feb 23, 2023

我发现这个case在新的版本编译后,已经修复了。好像不用再修了。

@luotao1
Copy link
Contributor

luotao1 commented Feb 23, 2023

我发现这个case在新的版本编译后,已经修复了。好像不用再修了。

@veyron95 请帮忙确认下~

@luotao1 luotao1 closed this Mar 22, 2023
@enkilee enkilee deleted the Fix_StackOverFlow_Case6 branch July 6, 2023 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants