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)
现在的版本会
导致运行到底层的算子代码才报错,并且没有提示信息。
其他补充信息 Additional Supplementary Information
version: 2.6.1
device:GPU
1条答案
按热度按时间yruzcnhs1#
感谢反馈,我们请对应的算子负责人评估下是否需要加上对于shape的检查~