Skip to content
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

Fix Python IndexError of Case12: paddle.static.nn.bilinear_tensor_product #50008

Merged
merged 23 commits into from
Feb 6, 2023

Conversation

longranger2
Copy link
Contributor

@longranger2 longranger2 commented Jan 22, 2023

PR types

Bug fixes

PR changes

APIs

Describe

Solution

原因:输入 的x和y的维度为1,导致param_shape = [size, x.shape[1], y.shape[1]]发生IndexError错误
解决方法:判断x和y的维度是否为2

@paddle-bot
Copy link

paddle-bot bot commented Jan 22, 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加个单测吧

@longranger2
Copy link
Contributor Author

单测已经添加好了

@luotao1
Copy link
Contributor

luotao1 commented Jan 31, 2023

单测已经添加好了

需要看下流水线报错信息,新增单测失败,如Py3流水线

2023-01-30 22:44:13 The following tests FAILED: 
2023-01-30 22:44:13 	414 - test_bilinear_tensor_product_op (Failed)

@longranger2
Copy link
Contributor Author

单测已经添加好了

需要看下流水线报错信息,新增单测失败,如Py3流水线

2023-01-30 22:44:13 The following tests FAILED: 
2023-01-30 22:44:13 	414 - test_bilinear_tensor_product_op (Failed)

修改好了

"Input y should be 2D tensor, but received y with the shape of {}".format(
y.shape
)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

image

单测覆盖率不够,可以再添加下单测,或者把2571和2577行写在一起,类似
if len(x.shape) != 2 || len(y.shape) != 2:
raise ValueError(
            "Input x and y should be 2D tensor, but received x and y with shape xxxx"
        )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

好的👌

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.

LGTM

@luotao1 luotao1 merged commit 8fb2dce into PaddlePaddle:develop Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants