-
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
转换规则 No.243-300 其他未领取项 #217
Conversation
Thanks for your contribution! |
tests/test_autograd_function_FunctionCtx_mark_non_differentiable.py
Outdated
Show resolved
Hide resolved
tests/test_autograd_function_FunctionCtx_mark_non_differentiable.py
Outdated
Show resolved
Hide resolved
return x+x+x, x+x | ||
|
||
@staticmethod | ||
def backward(ctx, grad, grad2): |
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.
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.
@co63oc 另外还需要处理下冲突 |
已修改 |
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.
else: | ||
API_TEMPLATE = textwrap.dedent( | ||
""" | ||
_, {}, _ = {} |
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.
直接写{}[1]
可以吧,省一行
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.
如果转换后代码末尾为[]符号,测试框架会不转换api ,所以这里增加一行取数组元素,然后赋值
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.
在 paconvert/transformer/basic_transformer.py:337 这里加一下 ast.Subscript
就可以
return x+x+x, x+x | ||
|
||
@staticmethod | ||
def backward(ctx, grad, grad2): |
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.
不能识别应该也会原封不动,这里如果函数名一致是不是也不会出错
tests/test_linalg_svdvals.py
Outdated
""" | ||
import torch | ||
x = torch.tensor([[12., -51, 4], [6, 167, -68], [-4, 24, -41]]) | ||
result = torch.linalg.svdvals(x, driver=None) |
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.
driver是属于 暂无转写方式 还是 可直接删除?
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.
driver是可直接删除,已修改文档
check_dtype=True, | ||
check_stop_gradient=True, | ||
): | ||
assert isinstance(paddle_result, paddle.nn.Linear) |
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.
好的 |
else: | ||
API_TEMPLATE = textwrap.dedent( | ||
""" | ||
_, {}, _ = {} |
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.
这个地方改成 {}[1],在 paconvert/transformer/basic_transformer.py:337 这里加一下 ast.Subscript 就可以通过了,可以省去一行
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.
LGTM
PR Docs
#112
映射文档 PaddlePaddle/docs#6075
PR APIs