Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
6d5fc220
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
6d5fc220
编写于
9月 17, 2021
作者:
Z
Zhong Hui
提交者:
GitHub
9月 17, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix segment api document. (#35818)
上级
0f74e5e7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
18 addition
and
20 deletion
+18
-20
python/paddle/incubate/tensor/__init__.py
python/paddle/incubate/tensor/__init__.py
+1
-6
python/paddle/incubate/tensor/math.py
python/paddle/incubate/tensor/math.py
+17
-14
未找到文件。
python/paddle/incubate/tensor/__init__.py
浏览文件 @
6d5fc220
...
...
@@ -17,9 +17,4 @@ from .math import segment_mean
from
.math
import
segment_max
from
.math
import
segment_min
__all__
=
[
'segment_sum'
,
'segment_mean'
,
'segment_max'
,
'segment_min'
,
]
__all__
=
[]
python/paddle/incubate/tensor/math.py
浏览文件 @
6d5fc220
...
...
@@ -12,22 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
__all__
=
[
'segment_sum'
,
'segment_mean'
,
'segment_max'
,
'segment_min'
,
]
import
paddle
from
paddle.fluid.layer_helper
import
LayerHelper
,
in_dygraph_mode
from
paddle.fluid.data_feeder
import
check_variable_and_dtype
from
paddle
import
_C_ops
__all__
=
[]
def
segment_sum
(
data
,
segment_ids
,
name
=
None
):
"""
r
"""
Segment Sum Operator.
This operator sums the elements of input `data` which with
...
...
@@ -40,6 +33,9 @@ def segment_sum(data, segment_ids, name=None):
segment_ids (Tensor): A 1-D tensor, which have the same size
with the first dimension of input data.
Available data type is int32, int64.
name (str, optional): Name for the operation (optional, default is None).
For more information, please refer to :ref:`api_guide_Name`.
Returns:
output (Tensor): the reduced result.
...
...
@@ -76,7 +72,7 @@ def segment_sum(data, segment_ids, name=None):
def
segment_mean
(
data
,
segment_ids
,
name
=
None
):
"""
r
"""
Segment mean Operator.
Ihis operator calculate the mean value of input `data` which
...
...
@@ -90,6 +86,8 @@ def segment_mean(data, segment_ids, name=None):
segment_ids (tensor): a 1-d tensor, which have the same size
with the first dimension of input data.
available data type is int32, int64.
name (str, optional): Name for the operation (optional, default is None).
For more information, please refer to :ref:`api_guide_Name`.
Returns:
output (Tensor): the reduced result.
...
...
@@ -127,7 +125,7 @@ def segment_mean(data, segment_ids, name=None):
def
segment_min
(
data
,
segment_ids
,
name
=
None
):
"""
r
"""
Segment min operator.
This operator calculate the minimum elements of input `data` which with
...
...
@@ -140,6 +138,9 @@ def segment_min(data, segment_ids, name=None):
segment_ids (tensor): a 1-d tensor, which have the same size
with the first dimension of input data.
available data type is int32, int64.
name (str, optional): Name for the operation (optional, default is None).
For more information, please refer to :ref:`api_guide_Name`.
Returns:
output (Tensor): the reduced result.
...
...
@@ -176,12 +177,12 @@ def segment_min(data, segment_ids, name=None):
def
segment_max
(
data
,
segment_ids
,
name
=
None
):
"""
r
"""
Segment max operator.
This operator calculate the maximum elements of input `data` which with
the same index in `segment_ids`.
It computes a tensor such that $out_i =
\\
m
in
_{j} data_{j}$
It computes a tensor such that $out_i = \\m
ax
_{j} data_{j}$
where max is over j such that `segment_ids[j] == i`.
Args:
...
...
@@ -189,6 +190,8 @@ def segment_max(data, segment_ids, name=None):
segment_ids (tensor): a 1-d tensor, which have the same size
with the first dimension of input data.
available data type is int32, int64.
name (str, optional): Name for the operation (optional, default is None).
For more information, please refer to :ref:`api_guide_Name`.
Returns:
output (Tensor): the reduced result.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录