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]()

```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]()

```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,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…


### [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.linalg.slogdet](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/slogdet_cn.html)

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


### 参数映射

| PyTorch | PaddlePaddle | 备注 |
|---------|--------------| ---------------------------------------------------- |
| - | x | 输入一个或批量矩阵。x 的形状应为 [*, M, M],其中 * 为零或更大的批次维度,数据类型支持 float32、float64。|