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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ]torch.Tensor.arcsinh

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

```python
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~


```python
paddle.Tensor.asinh()
```

两者功能一致,均无参数。
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ]torch.Tensor.asinh

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

```python
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.

这个链接也为空就可以~


```python
paddle.Tensor.asinh()
```

两者功能一致,均无参数。
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ] torch.Tensor.rsqrt

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

```python
torch.Tensor.rsqrt()
```

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

```python
paddle.Tensor.rsqrt()
```

两者功能一致,均无参数。
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ]torch.Tensor.rsqrt_

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

```python
torch.Tensor.rsqrt_()
```

### [paddle.Tensor.rsqrt_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#id15)

```python
paddle.Tensor.rsqrt_()
```

两者功能一致,均无参数。
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## [ 仅参数名不一致 ]torch.Tensor.select

### [torch.Tensor.select](https://pytorch.org/docs/stable/generated/torch.Tensor.select.html?highlight=select#torch.Tensor.select)

```python
torch.Tensor.select(dim, index)
```

### [paddle.index_select](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#index-select-index-axis-0-name-none)

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

两者功能一致且参数用法一致,仅参数名不一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| dim | axis | 指定进行运算的轴,仅参数名不同。 |
| index | index | 包含索引下标的 1-D Tensor |
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
## torch.Tensor.sigmoid
### [torch.Tensor.sigmoid](https://pytorch.org/docs/stable/generated/torch.Tensor.sigmoid.html?highlight=torch+sigmoid#torch.Tensor.sigmoid)
## [ 无参数 ]torch.Tensor.sigmoid

### [torch.Tensor.sigmoid](https://pytorch.org/docs/stable/generated/torch.Tensor.sigmoid)
hongtushi marked this conversation as resolved.
Show resolved Hide resolved

```python
torch.Tensor.sigmoid()
```

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

```python
paddle.nn.functional.sigmoid(x, name=None)
paddle.Tensor.sigmoid()
```

两者功能一致,参数一致,但 torch 是类成员方式,paddle 是 funtion 调用方式。

### 转写示例

```python
# torch 写法
x.sigmoid()

# paddle 写法
paddle.nn.functional.sigmoid(x)
```
两者功能一致,均无参数。
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ]torch.Tensor.sign

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

```python
torch.Tensor.sign()
```

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

```python
paddle.Tensor.sign()
```

两者功能一致,均无参数。
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ]torch.Tensor.sin

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

```python
torch.Tensor.sin()
```

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

```python
paddle.Tensor.sin()
```

两者功能一致,均无参数。
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ]torch.Tensor.sinh

### [torch.Tensor.sinh](https://pytorch.org/docs/1.13/generated/torch.Tensor.sinh.html?highlight=torch+tensor+sinh#torch.Tensor.sinh)

```python
torch.Tensor.sinh()
```

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

```python
paddle.Tensor.sinh()
```

两者功能一致,均无参数。
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ]torch.Tensor.slogdet

### [torch.Tensor.slogdet](https://pytorch.org/docs/stable/generated/torch.Tensor.slogdet.html?highlight=torch+tensor+slogdet#torch.Tensor.slogdet)

```python
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)


```python
paddle.Tensor.slogdet()
```

两者功能一致,均无参数。