Skip to content

Commit

Permalink
映射文档 No. 11 (#5709)
Browse files Browse the repository at this point in the history
* add gcd

* add gcd

* add ge

* add outer

* add get_divice

* add gt

* add hardshrink

* add heaviside

* add hist

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* Update torch.Tensor.gcd.md

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

* Update torch.Tensor.hardshrink.md

* Update torch.Tensor.hardshrink.md

* Apply suggestions from code review

* Apply suggestions from code review

* Update torch.Tensor.histc.md

* Update torch.Tensor.histc.md
  • Loading branch information
Liyulingyue authored Apr 25, 2023
1 parent 63362b7 commit 23e54b4
Show file tree
Hide file tree
Showing 10 changed files with 192 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## [ 仅参数名不一致 ]torch.Tensor.gcd

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

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

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

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

两者功能一致,仅参数名不一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> other </font> | <font color='red'> y </font> | 输入的 Tensor ,仅参数名不同。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## [ 仅参数名不一致 ]torch.Tensor.ge

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

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

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

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

两者功能一致,仅参数名不一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> other </font> | <font color='red'> y </font> | 输入的 Tensor ,仅参数名不同。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## [ 仅参数名不一致 ]torch.Tensor.ger

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

```python
torch.Tensor.ger(vec2)
```

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

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

两者功能一致,仅参数名不一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|--------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> vec2 </font> | <font color='red'> y </font> | 输入的 Tensor ,仅参数名不同。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ]torch.Tensor.get_device

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

```python
torch.Tensor.get_device()
```

### [paddle.device.get_device]()

```python
paddle.device.get_device()
```

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

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

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

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

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

两者功能一致,仅参数名不一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> other </font> | <font color='red'> y </font> | 输入的 Tensor ,仅参数名不同。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## [ 仅参数名不一致 ]torch.Tensor.greater_equal

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

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

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

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

两者功能一致,仅参数名不一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> other </font> | <font color='red'> y </font> | 输入的 Tensor ,仅参数名不同。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## [ 仅参数名不一致 ]torch.Tensor.gt

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

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

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

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

两者功能一致,仅参数名不一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> other </font> | <font color='red'> y </font> | 输入的 Tensor ,仅参数名不同。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## [ 仅参数名不一致 ]torch.Tensor.hardshrink

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

```python
torch.Tensor.hardshrink(lambd=0.5)
```

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

```python
paddle.Tensor.hardshrink(threshold=0.5, name=None)
```

两者功能一致且参数用法一致。

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
|-----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> lambd </font> | <font color='red'> threshold </font> | Hardshrink 阈值,仅参数名不同。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## [ 仅参数名不一致 ]torch.Tensor.heaviside

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

```python
torch.Tensor.heaviside(values)
```

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

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

两者功能一致,仅参数名不一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|-----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> values </font> | <font color='red'> y </font> | 输入的 Tensor ,仅参数名不同。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## [ 参数完全一致 ]torch.Tensor.histc

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

```python
torch.Tensor.histc(bins=100, min=0, max=0)
```

### [paddle.Tensor.histogram](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/Tensor_cn.html#histogram-bins-100-min-0-max-0)

```python
paddle.Tensor.histogram(bins=100, min=0, max=0, name=None)
```

两者功能一致且参数完全一致。

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
|-----------------------------------|------------------------------| ------------------------------------------------------ |
| <font color='red'> bins </font> | <font color='red'> bins </font> | 直方图 bins(直条)的个数,默认为 100。 |
| <font color='red'> min </font> | <font color='red'> min </font> | range 的下边界(包含),默认为 0。 |
| <font color='red'> max </font> | <font color='red'> max </font> | range 的上边界(包含),默认为 0。 |

0 comments on commit 23e54b4

Please sign in to comment.