Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
【PaddlePaddle Hackathon 3】5 新增 API bucketize (#5089)
* 更新paddle.bucketize的中文文档 * 更新paddle.bucketize API 文档说明 * Update buckiteze_cn.rst * Update Tensor_cn.rst * 更新bucketize API 文档,并修改searchsorted_cn.rst 文档说明 * 更新bucketize API 文档 和api_label,并修改searchsorted_cn.rst 文档说明 * Update api_label * Update bucketize_cn.rst
- Loading branch information
Showing
6 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,7 @@ Methods | |
broadcast_shape | ||
broadcast_tensors | ||
broadcast_to | ||
bucketize | ||
cast | ||
ceil | ||
ceil_ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.. _cn_api_tensor_bucketize: | ||
|
||
paddle.bucketize | ||
------------------------------- | ||
|
||
.. py:function:: paddle.bucketize(x, sorted_sequence, out_int32=False, right=False, name=None) | ||
将根据给定的一维Tensor ``sorted_sequence`` 返回输入 ``x`` 对应的桶索引。 | ||
|
||
参数 | ||
:::::::::: | ||
- **x** (Tensor) - 输入的N维Tensor,支持的数据类型:int32、int64、float32、float64。 | ||
- **sorted_sequence** (Tensor) - 输入的一维Tensor,支持的数据类型:int32、int64、float32、float64。该Tensor的数值在其最后一个维度递增。 | ||
- **out_int32** (bool,可选) - 输出的数据类型支持int32、int64。默认值为False,表示默认的输出数据类型为int64。 | ||
- **right** (bool,可选) - 根据给定 ``x`` 在 ``sorted_sequence`` 查找对应的上边界或下边界。如果 ``sorted_sequence``的值为nan或inf,则返回最内层维度的大小。默认值为False,表示在 ``sorted_sequence`` 的查找给定 ``x`` 的下边界。 | ||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
||
返回 | ||
:::::::::: | ||
Tensor(与 ``x`` 维度相同),如果参数 ``out_int32`` 为False,则返回数据类型为int64的Tensor,否则将返回int32的Tensor。 | ||
|
||
代码示例 | ||
:::::::::: | ||
|
||
COPY-FROM: paddle.bucketize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters