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

paddle.nn.AdaptiveAvgPool2D没有对输入的维度进行检查 #64449

Open
PhyllisJi opened this issue May 20, 2024 · 1 comment
Open

paddle.nn.AdaptiveAvgPool2D没有对输入的维度进行检查 #64449

PhyllisJi opened this issue May 20, 2024 · 1 comment
Assignees

Comments

@PhyllisJi
Copy link

bug描述 Describe the Bug

# 定义输入张量的形状
batch_size = 10
channels = 3
length = 32
input_tensor = paddle.randn([batch_size, channels, length])
adaptive_avg_pool = nn.AdaptiveAvgPool2D(output_size=16)
output_tensor = adaptive_avg_pool(input_tensor)
print(output_tensor.shape)

该API支持四维输入,但是没有对输入的维度进行检查,TensorFlow在同样的情况下会报错

Input 0 of layer "xxxx" is incompatible with the layer: expected ndim=4, found ndim=2. Full shape received: (None, 120)

现在的版本会
导致运行到底层的算子代码才报错,并且没有提示信息。
截屏2024-05-20 15 35 10

其他补充信息 Additional Supplementary Information

version: 2.6.1
device:GPU

@0x45f
Copy link
Contributor

0x45f commented May 20, 2024

感谢反馈,我们请对应的算子负责人评估下是否需要加上对于shape的检查~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants