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 20 #5733

Merged
merged 11 commits into from
Apr 11, 2023
Merged

映射文档 No 20 #5733

merged 11 commits into from
Apr 11, 2023

Conversation

hongtushi
Copy link
Contributor

@hongtushi hongtushi commented Mar 15, 2023

#5691
这个参数out,我不太确定算不算tensor的参数

@paddle-bot
Copy link

paddle-bot bot commented Mar 15, 2023

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-5733.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

@paddle-bot
Copy link

paddle-bot bot commented Mar 15, 2023

❌ The PR's message can't be empty.

@CLAassistant
Copy link

CLAassistant commented Mar 15, 2023

CLA assistant check
All committers have signed the CLA.

@hongtushi hongtushi changed the title '提交api映射文档(第20组api)' 映射文档 No 20 Mar 15, 2023
Copy link
Collaborator

@Skylark-hjyp Skylark-hjyp left a comment

Choose a reason for hiding this comment

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

共性问题:

对于调用 Tensor.* 方法是,其API 名称为 torch.Tensor.* ,调用方式为 Tensor.*,辛苦修改一下~

torch.sigmoid(input, *, out=None)
```

### [paddle.nn.functional.sigmoid](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/sigmoid_cn.html)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里对应的 API 应该是 paddle.Tensor.sigmoid

### [torch.Tensor.sign](https://pytorch.org/docs/stable/generated/torch.Tensor.sign)

```python
torch.sign(input, *, out=None)
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.sin](https://pytorch.org/docs/stable/generated/torch.Tensor.sin)

```python
torch.sinh(input, *, out=None)
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.slogdet](https://pytorch.org/docs/stable/generated/torch.Tensor.slogdet.html?highlight=torch+tensor+slogdet#torch.Tensor.slogdet)

```python
torch.slogdet(input)
Copy link
Collaborator

Choose a reason for hiding this comment

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

问题同上

@@ -0,0 +1,22 @@
## [ torch 参数更多 ]torch.Tensor.select
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里分类应该是仅参数名不一致

paddle.Tensor.index_select(index, axis=0, name=None)
```

其中 Pytorch 相⽐ 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.slogdet()
```

### [paddle.Tensor.slogdet](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#slogdet-name-none)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个链接没有slogdet吧,直接为空就可以了~

@Skylark-hjyp
Copy link
Collaborator

同学,有时间的话可以根据修改意见修改一下,这样就能尽快合并了~

torch.Tensor.arcsinh()
```

### [paddle.Tensor.asinh](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#asinh-name-none)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个官网链接是空的吧,直接为空就可以了,目前在Tensor页面还没更新asinh~

torch.Tensor.asinh()
```

### [paddle.Tensor.asinh](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#asinh-name-none)
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.slogdet()
```

### [paddle.Tensor.slogdet]()
Copy link
Collaborator

Choose a reason for hiding this comment

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

经过测试,目前还不支持直接在Tensor上使用该函数,只能通过paddle.linalg.slogdet进行调用。
所以这里分类需要改成仅paddle参数更多,调用的方法辛苦改成paddle.linalg.slogdet,一句话描述部分和参数映射部分也相应修改一下~,可以参考https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/linalg/slogdet_cn.html

x =  paddle.randn([3,3,3])
y = paddle.linalg.slogdet(x)
print(y)

Copy link
Collaborator

@Skylark-hjyp Skylark-hjyp left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -0,0 +1,21 @@
## [ 仅 paddle 参数更多 ]torch.Tensor.slogdet
Copy link
Collaborator

Choose a reason for hiding this comment

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

你好,这里辛苦改为 无参数 吧,根据最新的标准,这种情况不需要比对第一个参数了~
Uploading image.png…

paddle.linalg.slogdet(x)
```

两者功能一致,其中 Paddle 相比 Pytorch 支持更多其他参数,具体如下:
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里改为两者功能一致,无参数吧,下面的参数映射部分可以去掉

Copy link
Collaborator

Choose a reason for hiding this comment

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

CI不通过的原因应该是服务器代理的问题,正好重新提交一下会触发CI
image

@zhwesky2010 zhwesky2010 merged commit 3f43c97 into PaddlePaddle:develop Apr 11, 2023
@luotao1
Copy link
Collaborator

luotao1 commented Apr 11, 2023

hi, @hongtushi

  • 非常感谢你对飞桨框架的贡献,我们正在运营一个PFCC组织,会通过定期分享技术知识与发布开发者主导任务的形式持续为飞桨框架做贡献,详情可见 https://github.com/luotao1 主页说明。
  • 如果你对PFCC有兴趣,请发送邮件至 [email protected],我们会邀请你加入~

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

Successfully merging this pull request may close these issues.

5 participants