-
Notifications
You must be signed in to change notification settings - Fork 118
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
[PaddlePaddle hackathon] add UpsamplingNearest2D unittest #35964 #224
Conversation
@kolinwei 请问这个linux -ci的报错怎么改呀,我觉得好像没什么问题也不知道哪里错了 |
|
@kolinwei 佬,改好了~ |
|
||
|
||
@pytest.mark.api_nn_UpsamplingNearest2d_vartype | ||
def test_upsamplingnearest2d(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_upsamplingnearest2d和test_upsamplingnearest2d_base有啥区别,每个case需要验证不同的测试点
size = None | ||
scale_factor = 5 | ||
res = upsample_2d(img=x, size=size, scale_factor=scale_factor, data_format=data_format) | ||
obj.run(res=res, data=x, size=size, scale_factor=scale_factor, data_format=data_format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
补充更多的测试case,比如size(scale_factor)为其他类型输入时(tuple|Tensor)等。输入x的值包含负数等异常情况。
def test_upsamplingnearest2d_base(): | ||
""" | ||
base | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doc部分详细描述下该测试用例的验证点,测试输入,预期结果等,通过doc部分可以清楚的知晓该用例的测试点。
@kolinwei 请问为什么我的报错一直提示我说to_tense中出现了问题呢,是paddle内部出现bug了嘛,困惑好几天了,在群里也问了,但是没有合适的解决方案,需要大佬帮忙解决一下orz |
这个出错原因是这样的,测试框架默认传入类型为numpy的参数,会在底层转成Tensor。你这个报错是6,8两个Case,因为你传入了一个动态图的Tensor,底层框架的静态图没有这个函数,所以这就是报错的原因。如果一个API的参数支持Tensor类型的输入,只需要传入numpy即可,因为测试框架目的就是为了尽可能脱离paddle概念,方便补充测试用例。 |
|
@kolinwei 佬~改好啦 |
PR types
Others
PR changes
Others
Describe