import paddle
a = paddle.randn((2, 16640, 64))
out = paddle.nn.functional.fold(a, output_sizes=(4096, 1), kernel_sizes=[65, 1], paddings=[1, 0], strides=[64, 1])
print(out.shape)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In[2], line 3
1 import paddle
2 a = paddle.randn((2, 16640, 64))
----> 3 out = paddle.nn.functional.fold(a, output_sizes=(4096, 1), kernel_sizes=[65, 1], paddings=[1, 0], strides=[64, 1])
4 print(out.shape)
File /opt/conda/envs/python35-paddle120-env/lib/python3.10/site-packages/paddle/nn/functional/common.py:2405, in fold(x, output_sizes, kernel_sizes, strides, paddings, dilations, name)
2399 raise ValueError(
2400 "Unexpected type of paddings, it should be either an integer or a list"
2401 "of 2 or 4 integers"
2402 )
2404 if in_dynamic_mode():
-> 2405 out = _C_ops.fold(
2406 x, output_sizes, kernel_sizes, strides, paddings, dilations
2407 )
2408 else:
2409 out = helper.create_variable_for_type_inference(dtype=x.dtype)
ValueError: (InvalidArgument) The `output_width` should be greater than one, but received output_width: 1 .
[Hint: Expected output_width > 1, but received output_width:1 <= 1:1.] (at /paddle/paddle/phi/infermeta/unary.cc:1603)
但是torch能执行正常
import torch
a = torch.rand((2, 16640, 64))
out = torch.nn.functional.fold(a, output_size=(4096, 1), kernel_size=[65, 1], padding=[1, 0], stride=[64, 1])
print(out.shape)
bug描述 Describe the Bug
aistudio环境 2.5和3.0都一样
但是torch能执行正常
结果 torch.Size([2, 256, 4096, 1])
其他补充信息 Additional Supplementary Information
No response