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

Update torch.tensor_split.md #6732

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all 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
@@ -1,4 +1,4 @@
## [ 仅参数名不一致 ]torch.tensor_split
## [ 参数用法不一致 ]torch.tensor_split
### [torch.tensor_split](https://pytorch.org/docs/stable/generated/torch.tensor_split.html)

```python
Expand All @@ -11,12 +11,12 @@ torch.tensor_split(input, indices_or_sections, dim=0)
paddle.tensor_split(x, num_or_indices, axis=0, name=None)
```

其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下:
其中 Paddle 相比 PyTorch 参数用法不一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor ,仅参数名不一致。 |
| indices_or_sections | num_or_indices | 表示分割的数量或索引,仅参数名不一致。 |
| indices_or_sections | num_or_indices | indices_or_sections必须分开使用,indices和sections均可作为位置参数或关键字参数使用,num_or_indices不可分开使用。 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

分两个签名写吧,不同的签名各写各的,仍属于 仅参数名不一致

参考 torch.max的写法:
https://github.com/PaddlePaddle/docs/blob/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.max.md

| dim | axis | 表示需要分割的维度,仅参数名不一致。 |