-
Notifications
You must be signed in to change notification settings - Fork 115
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】49. Add test of paddle.nn.functional.conv2d transpose #251
【PaddlePaddle Hackathon】49. Add test of paddle.nn.functional.conv2d transpose #251
Conversation
…into add-test-of-paddle.nn.functional.conv2d_transpose
groups=groups, | ||
output_size=None, | ||
data_format="NHWC", | ||
) |
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,比如某个参数的值不在规定范围内
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.
好的,收到。我增加了两个obj.exception的异常输入类的case
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.
…ttps://github.com/SmirnovKol/PaddleTest into add-test-of-paddle.nn.functional.conv2d_transpose
""" | ||
implement | ||
""" | ||
self.types = [np.float32] |
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.
验证下float16,和float64下的功能
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.
在float16下会报错,如下所示:
E RuntimeError: (NotFound) Operator conv2d_transpose does not have kernel for data_type[::paddle::platform::float16]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN].
E [Hint: Expected kernel_iter != kernels.end(), but received kernel_iter == kernels.end().] (at C:\home\workspace\Paddle_release\paddle\fluid\imperative\prepared_operator.cc:135)
E [operator < conv2d_transpose > error]
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.
在float64下可以测试通过
weight = np.full(shape=[in_channels, out_channels] + kernel_size, fill_value=3.3) | ||
bias = np.full(shape=[out_channels], fill_value=-1.7) | ||
stride = 1 | ||
padding = 1 |
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.
padding需要多测一下,可以参照文档中的描述:
padding (int|list|tuple|str,可选) - 填充大小。如果它是一个字符串,可以是"VALID"或者"SAME",表示填充算法,计算细节可参考上述 padding = "SAME"或 padding = "VALID" 时的计算公式。如果它是一个元组或列表,它可以有3种格式:(1)包含4个二元组:当 data_format 为"NCHW"时为 [[0,0], [0,0], [padding_height_top, padding_height_bottom], [padding_width_left, padding_width_right]],当 data_format 为"NHWC"时为[[0,0], [padding_height_top, padding_height_bottom], [padding_width_left, padding_width_right], [0,0]];(2)包含4个整数值:[padding_height_top, padding_height_bottom, padding_width_left, padding_width_right];(3)包含2个整数值:[padding_height, padding_width],此时padding_height_top = padding_height_bottom = padding_height, padding_width_left = padding_width_right = padding_width。若为一个整数,padding_height = padding_width = padding。默认值:0。
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.
已增加更多关于padding的测试
add more test cases of the padding argument
PR types
New features
PR changes
add framework/api/nn/test_functional_conv2d_transpose.py
Describe
Task: PaddlePaddle/Paddle#35956
add pytest of paddle.nn.functional.conv2d_transpose