Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
73632dee
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
73632dee
编写于
11月 03, 2017
作者:
A
Abhinav Arora
提交者:
GitHub
11月 03, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Polish the documentation for uniform_random and top_k ops (#5353)
上级
83c22816
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
33 addition
and
21 deletion
+33
-21
paddle/operators/top_k_op.cc
paddle/operators/top_k_op.cc
+12
-12
paddle/operators/uniform_random_op.cc
paddle/operators/uniform_random_op.cc
+21
-9
未找到文件。
paddle/operators/top_k_op.cc
浏览文件 @
73632dee
...
@@ -48,20 +48,20 @@ class TopkOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -48,20 +48,20 @@ class TopkOpMaker : public framework::OpProtoAndCheckerMaker {
public:
public:
TopkOpMaker
(
framework
::
OpProto
*
proto
,
framework
::
OpAttrChecker
*
op_checker
)
TopkOpMaker
(
framework
::
OpProto
*
proto
,
framework
::
OpAttrChecker
*
op_checker
)
:
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
:
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
AddInput
(
"X"
,
"The input of Topk op"
);
AddInput
(
"X"
,
"(Tensor) The input of Topk op"
);
AddOutput
(
"Out"
,
"The output tensor of Topk op"
);
AddOutput
(
"Out"
,
"(Tensor) The output tensor of Topk op"
);
AddOutput
(
"Indices"
,
"The indices of Topk elements of input"
);
AddOutput
(
"Indices"
,
"(Tensor) The indices of Topk elements of input"
);
AddComment
(
AddComment
(
R"DOC(
R"DOC(If the input is a vector (1d tensor),
Top K operator
finds the k largest entries in the vector
and outputs their values and indices as vectors.
Thus values[j] is the j-th largest entry in input,
and its index is indices[j].
For matrices, computes the top k entries in each row. )DOC"
);
If the input is a vector (1d tensor), this operator finds the k largest
entries in the vector and outputs their values and indices as vectors.
Thus values[j] is the j-th largest entry in input, and its index is indices[j].
For matrices, this operator computes the top k entries in each row. )DOC"
);
AddAttr
<
int
>
(
"k"
,
AddAttr
<
int
>
(
"k"
,
"
Number of top elements to look for along the last
"
"
(int, default 1) Number of top elements to look for along
"
"dimension (along each row for matrices)."
)
"
the last
dimension (along each row for matrices)."
)
.
SetDefault
(
1
);
.
SetDefault
(
1
);
}
}
};
};
...
...
paddle/operators/uniform_random_op.cc
浏览文件 @
73632dee
...
@@ -74,18 +74,30 @@ class UniformRandomOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -74,18 +74,30 @@ class UniformRandomOpMaker : public framework::OpProtoAndCheckerMaker {
UniformRandomOpMaker
(
framework
::
OpProto
*
proto
,
UniformRandomOpMaker
(
framework
::
OpProto
*
proto
,
framework
::
OpAttrChecker
*
op_checker
)
framework
::
OpAttrChecker
*
op_checker
)
:
framework
::
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
:
framework
::
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
AddOutput
(
"Out"
,
"The output tensor of uniform random op"
);
AddOutput
(
"Out"
,
"(Tensor) The output tensor of uniform random op"
);
AddComment
(
R"DOC(Uniform random operator.
AddComment
(
R"DOC(
Used to initialize tensor with uniform random generator.
Uniform random operator.
This operator initializes a tensor with random values sampled from a
uniform distribution.
)DOC"
);
)DOC"
);
AddAttr
<
std
::
vector
<
int
>>
(
"shape"
,
"the dimension of random tensor"
);
AddAttr
<
std
::
vector
<
int
>>
(
"shape"
,
AddAttr
<
float
>
(
"min"
,
"Minimum value of uniform random"
).
SetDefault
(
-
1.0
f
);
"(vector<int>) The shape of the output tensor"
);
AddAttr
<
float
>
(
"max"
,
"Maximun value of uniform random"
).
SetDefault
(
1.0
f
);
AddAttr
<
float
>
(
"min"
,
"(float, default -1.0) "
"Minimum value of uniform random"
)
.
SetDefault
(
-
1.0
f
);
AddAttr
<
float
>
(
"max"
,
"(float, default 1.0) "
"Maximun value of uniform random"
)
.
SetDefault
(
1.0
f
);
AddAttr
<
int
>
(
"seed"
,
AddAttr
<
int
>
(
"seed"
,
"Random seed of uniform random. "
"(int, default 0) "
"0 means generate a seed by system"
)
"Random seed used for generating samples. "
"0 means use a seed generated by the system."
)
.
SetDefault
(
0
);
.
SetDefault
(
0
);
AddAttr
<
int
>
(
"data_type"
,
"
o
utput tensor data type"
)
AddAttr
<
int
>
(
"data_type"
,
"
(int, default 5(FP32)) O
utput tensor data type"
)
.
SetDefault
(
framework
::
DataType
::
FP32
);
.
SetDefault
(
framework
::
DataType
::
FP32
);
}
}
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录