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

转换规则 No. 304/306/308/327-329/332/351/363/365/369/371 #241

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

co63oc
Copy link
Contributor

@co63oc co63oc commented Aug 22, 2023

PR Docs

#112
映射文档 PaddlePaddle/docs#6115

API 功能缺失
304 torch.resolve_conj
306 torch.special.multigammaln
308 torch.testing.make_tensor
327 torch.Tensor.retains_grad torch中为属性,paddle中为函数调用不同
328 torch.distributed.monitored_barrier,torch中使用 torch.distributed.barrier 映射,torch.distributed.monitored_barrier无映射接口
329 torch.Tensor.bitwise_left_shift_
332 torch.Tensor.bitwise_right_shift_
351 torch.autograd.Function.jvp 参数和paddle.incubate.autograd.jvp(func, xs, v=None)不一致
363 torch.sparse.sampled_addmm torch中有spy(input)参数,paddle addmm中无spy(input)
365 torch.utils.data.default_convert
369 torch.nn.utils.stateless.functional_call
371 torch.layout torch中为Tensor属性,paddle中无对应属性

PR APIs

@paddle-bot
Copy link

paddle-bot bot commented Aug 22, 2023

Thanks for your contribution!

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Aug 22, 2023
@co63oc co63oc changed the title 转换规则 No. 304/306/308/327-329 转换规则 No. 304/306/308/327-329/332/351/363/365/369/371 Aug 22, 2023
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Aug 23, 2023

from apibase import APIBase

obj = APIBase("torch.Tensor.retains_grad")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个需要把属性调用形式转写成 函数调用形式,看一下 Attribute2Func 这个Matcher

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

paddle中不获取返回值
图片

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

torch.Tensor.retains_grad这个是功能缺失,torch.Tensor.retain_grad 也一起弄下吧,torch.Tensor.retain_grad 可以和paddle对应上

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已有retain_grad单测 tests/test_Tensor_retain_grad.py,转换为 paddle.Tensor.retain_grads

Copy link
Collaborator

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhwesky2010 zhwesky2010 merged commit 35a76df into PaddlePaddle:master Aug 28, 2023
@co63oc co63oc deleted the api332 branch August 30, 2023 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR status: proposed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants