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

Fix dimension error in static mode. #42270

Closed
wants to merge 1 commit into from

Conversation

KPatr1ck
Copy link
Contributor

@KPatr1ck KPatr1ck commented Apr 26, 2022

PR types

Bug fixes

PR changes

APIs

Describe

paddle.signal.stft静态图计算结果shape有误

import paddle
from paddle.signal import stft
import numpy as np
import torch

# n_fft = 4
# print(n_fft//4)
# x_data = np.arange(4).astype('float64')
x_data = np.random.rand(4, )
# x_data = np.exp(3j * np.pi * np.arange(7) / 7)
x = paddle.to_tensor(x_data)
y1 = stft(x, 4, onesided=False)
print(y1)

paddle.enable_static()
main_program, startup_program = paddle.static.Program(), paddle.static.Program()
with paddle.utils.unique_name.guard():
    with paddle.static.program_guard(main_program=main_program, startup_program=startup_program):
        data0 = paddle.static.data(name='s0', shape=(4, ), dtype="float64")
        feed = {"s0": x_data}
        out = stft(data0, 4, onesided=False)
        exe = paddle.static.Executor()
        exe.run(startup_program)
        static_res = exe.run(main_program, feed=feed, fetch_list=[out])
paddle.disable_static()
print(static_res[0].shape)

文档描述有误:
image

@paddle-bot-old
Copy link

你的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-old
Copy link

paddle-bot-old bot commented May 4, 2022

Sorry to inform you that 1ccbf6f's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

Copy link

paddle-bot bot commented Feb 20, 2024

Since you haven't replied for more than a year, we have closed this issue/pr.
If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up.
由于您超过一年未回复,我们将关闭这个issue/pr。
若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。

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

Successfully merging this pull request may close these issues.

1 participant