-
Notifications
You must be signed in to change notification settings - Fork 53
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.36】为 Paddle 代码转换工具新增 API 转换规则(第 3 组)-part #479
base: master
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
单测未通过,请保证CI通过,CI不通过不予合入:
|
能否修复下CI看错误,谢谢。 |
…nto hackathon7-part1
@zhwesky2010 if self.is_aux_api:
paddle_code = (
textwrap.dedent(
"""
import sys
import importlib
sys.path.append('test_project/utils')
import paddle_aux
paddle_aux=importlib.reload(paddle_aux)
"""
)
+ paddle_code
)
> exec(paddle_code, locals())
> exec(paddle_code, locals())
E File "<string>", line 2
E >>>>>>result = torch.signal.windows.blackman(5)
E ^^
E SyntaxError: invalid syntax
tests/apibase.py:86: SyntaxError |
Code Style不用管,其他需要通过 |
应该是你本地环境不对吧,pip uninstall paconvert 试试,可能跑单测是site-packages环境里的paconvert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注意:
文档 与 Matcher 严格一致,发现Diff需要回头修正。
"M", | ||
"*", | ||
"center", | ||
"tau", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
恩,经过测试,是需要转写,已开pr改文档。
], | ||
"kwargs_change": { | ||
"M": "win_length", | ||
"a": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文档的转写方式看起来不是直接删除?是否有没对应上的diff?
没对应上的注意回头修正文档
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文档中a需要转写,a传入的是list, paddle组合成了 tuple(str, list)。a作为非可选参数,没有默认值。paddle中没有a这个参数,所以在general_cosine中,a默认为空。从pytorch拿值给a
pytorch:
torch.signal.windows.general_cosine(10, a=[0.46, 0.23, 0.31])
paddle:
paddle.audio.functional.get_window(('general_cosine', [0.46, 0.23, 0.31]), 10)
"dtype": "dtype" | ||
}, | ||
"paddle_default_kwargs": { | ||
"dtype": "paddle.float64", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个的设置是什么原因,文档中需要强调吗
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
paddle中默认float64。已开pr改文档。
def get_window(
window: _WindowLiteral | tuple[_WindowLiteral, float],
win_length: int,
fftbins: bool = True,
dtype: str = 'float64',
) -> Tensor:
def _gaussian(
M: int, std: float, sym: bool = True, dtype: str = 'float64'
) -> Tensor:
def _exponential(
M: int, center=None, tau=1.0, sym: bool = True, dtype: str = 'float64'
) -> Tensor:
PR Docs
PaddlePaddle/docs#6879
PR APIs