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

[Hackathon 7th No.55] BUG FIX paddle.nn.functional.fold #70102

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

DrRyanHuang
Copy link
Member

@DrRyanHuang DrRyanHuang commented Dec 10, 2024

PR Category

User Experience

PR Types

Bug fixes

Description

import paddle

unfolded = paddle.randn([16, 4410, 201])
folded = paddle.nn.functional.fold(
    unfolded,
    output_sizes=(1, 445410),
    kernel_sizes=(1, 4410),
    strides=(1, 2205), )
print(folded.shape)
(InvalidArgument) The `output_height` should be greater than one, but received output_height: 1 .
  [Hint: Expected output_height > 1, but received output_height:1 <= 1:1.] (at /paddle/paddle/phi/infermeta/unary.cc:1597)
  File "/home/aistudio/PaddleSpeech/audio/audiotools/core/dsp.py", line 131, in overlap_and_add
    folded = paddle.nn.functional.fold(
  File "/home/aistudio/PaddleSpeech/audio/tests/audiotools/core/test_dsp.py", line 31, in _test
    recombined = windowed_signal.overlap_and_add(hop_duration)
  File "/home/aistudio/PaddleSpeech/audio/tests/audiotools/core/test_dsp.py", line 36, in test_overlap_add
    _test(nz_signal)
  File "/home/aistudio/PaddleSpeech/audio/tests/audiotools/core/test_dsp.py", line 39, in <module>
    test_overlap_add(10.0, 44100, 0.1)

However,

import torch
unfolded = torch.randn(16, 4410, 201)
folded = torch.nn.functional.fold(
    unfolded,
    output_size=(1, 445410),
    kernel_size=(1, 4410),
    stride=(1, 2205),
)
print(folded.shape) # torch.Size([16, 1, 1, 445410])

Copy link

paddle-bot bot commented Dec 10, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Dec 10, 2024
@DrRyanHuang DrRyanHuang changed the title Fix paddle.nn.functional.fold [Hackathon 7th No.55] BUG FIX paddle.nn.functional.fold Dec 10, 2024
@luotao1
Copy link
Contributor

luotao1 commented Dec 16, 2024

CodeStyle没过

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

Successfully merging this pull request may close these issues.

3 participants