Skip to content

Commit

Permalink
映射文档 No.6 (PaddlePaddle#5757)
Browse files Browse the repository at this point in the history
* add md file

* fix

* fix

* fix error
  • Loading branch information
enkilee authored Mar 31, 2023
1 parent 6b0ff15 commit 397066d
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## [ 仅 Paddle 参数更多 ] torch.Tensor.count_nonzero

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

```python
torch.Tensor.count_nonzero(dim=None)
```

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

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

两者功能一致,仅 paddle 参数更多,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|---------|--------------| ----------------------------------------------------- |
| dim | axis | 指定对 x 进行计算的轴,仅参数名不一致。 |
| - | keepdim | 是否在输出 Tensor 中保留减小的维度,PyTorch 无此参数, Paddle 保持默认即可。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ] torch.Tensor.acosh

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

```python
torch.Tensor.acosh()
```

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

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

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

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

```python
torch.Tensor.chunk(chunks, dim=0)
```

### [paddle.Tensor.chunk](paddlepaddle.org.cn/documentation/docs/zh/api/paddle/Tensor_cn.html#chunk-chunks-axis-0-name-none)

```python
paddle.Tensor.chunk(chunks, axis=0, name=None)
```

两者功能一致,仅参数名不一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|------------| ------------ | ------------------------------------------------------ |
| chunks | chunks | 表示将输入 Tensor 划分成多少个相同大小的子 Tensor。 |
| dim | axis | 表示需要分割的维度,仅参数名不一致。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## [ 参数完全一致 ] torch.Tensor.clamp

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

```python
torch.Tensor.clamp(min=None, max=None)
```

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

```python
paddle.Tensor.clip(min=None, max=None, name=None)
```

两者功能一致,参数完全一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|---------|--------------| -------------------------------------------------- |
| min | min | 裁剪的最小值,输入中小于该值的元素将由该元素代替。 |
| max | max | 裁剪的最大值,输入中大于该值的元素将由该元素代替。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## [ 参数完全一致 ] torch.Tensor.clamp_

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

```python
torch.Tensor.clamp_(min=None, max=None)
```

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

```python
paddle.Tensor.clip_(min=None, max=None, name=None)
```

两者功能一致,参数完全一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|---------|--------------|---------------------------|
| min | min | 裁剪的最小值,输入中小于该值的元素将由该元素代替。 |
| max | max | 裁剪的最大值,输入中大于该值的元素将由该元素代替。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## [ 参数完全一致 ] torch.Tensor.clip

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

```python
torch.Tensor.clip(min=None, max=None)
```

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

```python
paddle.Tensor.clip(min=None, max=None, name=None)
```

两者功能一致,参数完全一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|---------|--------------| -------------------------------------------------- |
| min | min | 裁剪的最小值,输入中小于该值的元素将由该元素代替。 |
| max | max | 裁剪的最大值,输入中大于该值的元素将由该元素代替。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## [ 参数完全一致 ] torch.Tensor.clip_

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

```python
torch.Tensor.clip_(min=None, max=None)
```

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

```python
paddle.Tensor.clip_(min=None, max=None, name=None)
```

两者功能一致,参数完全一致,具体如下:
### 参数映射
| PyTorch | PaddlePaddle | 备注 |
|---------|--------------|---------------------------|
| min | min | 裁剪的最小值,输入中小于该值的元素将由该元素代替。 |
| max | max | 裁剪的最大值,输入中大于该值的元素将由该元素代替。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## [ 无参数 ] torch.Tensor.conj

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

```python
torch.Tensor.conj()
```

### [paddle.Tensor.conj](paddlepaddle.org.cn/documentation/docs/zh/api/paddle/Tensor_cn.html#conj-name-none)

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

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

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

```python
torch.Tensor.cos()
```

### [paddle.Tensor.cos](paddlepaddle.org.cn/documentation/docs/zh/api/paddle/Tensor_cn.html#cos-name-none)

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

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

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

```python
torch.Tensor.cosh()
```

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

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

两者功能完全一致,无参数。

0 comments on commit 397066d

Please sign in to comment.