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

add bincount api cn doc #3959

Merged
merged 3 commits into from
Oct 26, 2021
Merged

Conversation

smallv0221
Copy link
Contributor

@smallv0221 smallv0221 commented Oct 11, 2021

add bincount api cn doc
文档预览:
image


参数:
- **x** (Tensor) - 输入Tensor。必须是一维Tensor,其中元素必须大于等于0,数据类型为int32, int64。
- **weights** (Tensor, 可选) - weights Tensor,代表输入Tensor中每个元素的权重。长度必须与输入Tensor相同。数据类型为int32, int64, float32或float64。
Copy link
Collaborator

Choose a reason for hiding this comment

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

默认值:None。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

参数:
- **x** (Tensor) - 输入Tensor。必须是一维Tensor,其中元素必须大于等于0,数据类型为int32, int64。
- **weights** (Tensor, 可选) - weights Tensor,代表输入Tensor中每个元素的权重。长度必须与输入Tensor相同。数据类型为int32, int64, float32或float64。
- **minlength** (int) - 输出Tensor的最小长度,如果大于输入Tensor的长度,则多出的位置补0。该值必须大于等于0。默认为0。
Copy link
Collaborator

Choose a reason for hiding this comment

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

int -> int,可选

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


统计输入张量中每个元素出现的次数,如果传入weights张量则每次计数加一时会乘以weights张量对应的值

参数:
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
Contributor Author

Choose a reason for hiding this comment

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

Done

- **weights** (Tensor, 可选) - weights Tensor,代表输入Tensor中每个元素的权重。长度必须与输入Tensor相同。数据类型为int32, int64, float32或float64。
- **minlength** (int) - 输出Tensor的最小长度,如果大于输入Tensor的长度,则多出的位置补0。该值必须大于等于0。默认为0。

返回:Tensor,维度为1。
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
Contributor Author

Choose a reason for hiding this comment

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

Done


返回:Tensor,维度为1。

抛出异常:
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
Contributor Author

Choose a reason for hiding this comment

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

Done

- ``ValueError`` - 当输入Tensor或weights Tensor的值或形状不合法时。
- ``IndexError`` - 当输入minlength的值不合法时。

**代码示例**:
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
Contributor Author

Choose a reason for hiding this comment

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

Done


- **x** (Tensor) - 输入Tensor。必须是一维Tensor,其中元素必须大于等于0,数据类型为int32, int64。
- **weights** (Tensor, 可选) - weights Tensor,代表输入Tensor中每个元素的权重。长度必须与输入Tensor相同。数据类型为int32, int64, float32或float64。默认为None
- **minlength** (int, 可选) - 输出Tensor的最小长度,如果大于输入Tensor的长度,则多出的位置补0。该值必须大于等于0。默认为0。
Copy link
Collaborator

Choose a reason for hiding this comment

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

少了name参数

@TCChenlong TCChenlong merged commit 06cd600 into PaddlePaddle:develop Oct 26, 2021
smallv0221 added a commit to smallv0221/docs that referenced this pull request Oct 26, 2021
* add bincount api cn doc

* fix cn doc

* add name
smallv0221 added a commit that referenced this pull request Oct 27, 2021
* add bincount api cn doc

* fix cn doc

* add name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants