Skip to content

【映射文档】新增与维护部分映射文档 #6494

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

Merged
merged 4 commits into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## [ 仅参数名不一致 ]torch.Tensor.addmm

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

```python
torch.Tensor.addmm(mat1, mat2, *, beta=1, alpha=1)
```

### [paddle.Tensor.addmm]()

```python
paddle.Tensor.addmm(x, y, alpha=1.0, beta=1.0)
```

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

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| -------- | ------------ | -------------------------------- |
| mat1 | x | 表示输入的 Tensor,仅参数名不一致。 |
| mat2 | y | 表示输入的 Tensor,仅参数名不一致。 |
| beta | beta | 乘以 input 的标量。|
| alpha | alpha | 乘以 x*y 的标量。|
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个是乘以x还是乘以y?

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.addmmout=alpha∗x∗y+beta∗input,乘以 x*y

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ torch.Tensor.all(dim=None, keepdim=False)

```python
paddle.Tensor.all(axis=None,
keepdim=False,
name=None)
keepdim=False,
name=None)
```

其中 Paddle 与 PyTorch 运算 Tensor 所支持的类型不一致,具体如下:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## [ 仅参数名不一致 ]torch.Tensor.amax

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

```python
torch.Tensor.amax(dim=None, keepdim=False)
```

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

```python
paddle.Tensor.amax(axis=None, keepdim=False, name=None)
```

其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | ------------------ |
| dim | axis | 求最大值运算的维度,仅参数名不一致。 |
| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## [ 仅参数名不一致 ]torch.Tensor.amin

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

```python
torch.Tensor.amin(dim=None, keepdim=False)
```

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

```python
paddle.Tensor.amin(axis=None, keepdim=False, name=None)
```

其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | ------------------ |
| dim | axis | 求最小值运算的维度,仅参数名不一致。 |
| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ]torch.Tensor.angle

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

```python
torch.Tensor.angle()
```

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

```python
paddle.Tensor.angle(name=None)
```

两者功能一致,无参数。
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ torch.Tensor.any(dim=None, keepdim=False)

```python
paddle.Tensor.any(axis=None,
keepdim=False,
name=None)
keepdim=False,
name=None)
```

其中 Paddle 与 PyTorch 运算 Tensor 所支持的类型不一致,具体如下:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ] torch.Tensor.arccos

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

```python
torch.Tensor.arccos()
```

### [paddle.Tensor.acos]()

```python
paddle.Tensor.acos()
```

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

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

```python
torch.Tensor.arcsin()
```

### [paddle.Tensor.arcsin]()

```python
paddle.Tensor.arcsin()
```

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

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

```python
torch.Tensor.arctan()
```

### [paddle.Tensor.arctan]()

```python
paddle.Tensor.arctan()
```

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

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

```python
torch.Tensor.argmax(dim=None, keepdim=False)
```

### [paddle.Tensor.argmax](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#argmax-axis-none-keepdim-false-dtype-int64-name-none)

```python
paddle.Tensor.argmax(axis=None, keepdim=False, dtype=int64, name=None)
```

其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | ------------------ |
| dim | axis | 指定对输入 Tensor 进行运算的轴,仅参数名不一致。 |
| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

paddle的dtype没写,下个PR补上

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## [ 仅参数名不一致 ]torch.Tensor.argmin

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

```python
torch.Tensor.argmin(dim=None, keepdim=False)
```

### [paddle.Tensor.argmin](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#argmin-axis-none-keepdim-false-dtype-int64-name-none)

```python
paddle.Tensor.argmin(axis=None, keepdim=False, dtype=int64, name=None)
```

其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | ------------------ |
| dim | axis | 指定对输入 Tensor 进行运算的轴,仅参数名不一致。 |
| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

paddle的dtype没写,下个PR补上

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## [ 仅参数名不一致 ]torch.Tensor.argsort

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

```python
torch.Tensor.argsort(dim=-1, descending=False)
```

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

```python
paddle.Tensor.argsort(axis=-1, descending=False, name=None)
```

其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ---------- | ------------ | -- |
| dim | axis | 指定对输入 Tensor 进行运算的轴,仅参数名不一致。 |
| descending | descending | 指定算法排序的方向。如果设置为 True,算法按照降序排序。如果设置为 False 或者不设置,按照升序排序。默认值为 False。 |
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@

```python
torch.Tensor.as_strided(size,
stride,
storage_offset=None)
stride,
storage_offset=None)
```

### [paddle.Tensor.as_strided](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#as-strided-x-shape-stride-offset-0-name-none)

```python
paddle.Tensor.as_strided(shape,
stride,
offset=0,
name=None)
stride,
offset=0,
name=None)
```

两者功能一致且参数用法一致,仅参数名不一致,具体如下:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## [ 参数完全一致 ]torch.Tensor.bincount

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

```python
torch.Tensor.bincount(weights=None, minlength=0)
```

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

```python
paddle.Tensor.bincount(weights=None, minlength=0)
```

功能一致,参数完全一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| --------- | ------------ | -- |
| weights | weights | 输入 Tensor 中每个元素的权重。 |
| minlength | minlength | 输出 Tensor 的最小长度。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## [ 仅参数名不一致 ]torch.Tensor.bitwise_and

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

```python
torch.Tensor.bitwise_and(other)
```

### [paddle.Tensor.bitwise_and]()

```python
paddle.Tensor.bitwise_and(y)
```

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

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| other | y | 表示输入的 Tensor ,仅参数名不一致。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ]torch.Tensor.bitwise_not

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

```python
torch.Tensor.bitwise_not()
```

### [paddle.Tensor.bitwise_not]()

```python
paddle.Tensor.bitwise_not()
```

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

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

```python
torch.Tensor.bitwise_or(other)
```

### [paddle.Tensor.bitwise_or]()

```python
paddle.Tensor.bitwise_or(y)
```

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

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| other | y | 表示输入的 Tensor ,仅参数名不一致。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## [ 仅参数名不一致 ]torch.Tensor.bitwise_xor

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

```python
torch.Tensor.bitwise_xor(other)
```

### [paddle.Tensor.bitwise_xor]()

```python
paddle.Tensor.bitwise_xor(y)
```

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

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| other | y | 表示输入的 Tensor ,仅参数名不一致。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## [ 仅参数名不一致 ]torch.Tensor.bmm

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

```python
torch.Tensor.bmm(mat2)
```

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

```python
paddle.Tensor.bmm(y, name=None)
```

其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | -- |
| mat2 | y | 输入 Tensor,仅参数名不一致。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## [ 仅参数名不一致 ]torch.Tensor.broadcast_to

### [torch.Tensor.broadcast\_to](https://pytorch.org/docs/stable/generated/torch.Tensor.broadcast_to.html)

```python
torch.Tensor.broadcast_to(size)
```

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

```python
paddle.Tensor.broadcast_to(shape, name=None)
```

其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | -- |
| size | shape | 给定输入 x 扩展后的形状,仅参数名不一致。 |
Loading