Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
af760eac
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看板
提交
af760eac
编写于
11月 03, 2017
作者:
K
kexinzhao
提交者:
Yi Wang
11月 03, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
polish op from e to f (#5357)
上级
c5c02437
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
66 addition
and
39 deletion
+66
-39
paddle/operators/elementwise_add_op.cc
paddle/operators/elementwise_add_op.cc
+1
-1
paddle/operators/elementwise_div_op.cc
paddle/operators/elementwise_div_op.cc
+1
-1
paddle/operators/elementwise_mul_op.cc
paddle/operators/elementwise_mul_op.cc
+1
-1
paddle/operators/elementwise_op.h
paddle/operators/elementwise_op.h
+30
-25
paddle/operators/elementwise_sub_op.cc
paddle/operators/elementwise_sub_op.cc
+1
-1
paddle/operators/feed_op.cc
paddle/operators/feed_op.cc
+7
-2
paddle/operators/fetch_op.cc
paddle/operators/fetch_op.cc
+7
-2
paddle/operators/fill_constant_batch_size_like_op.cc
paddle/operators/fill_constant_batch_size_like_op.cc
+7
-2
paddle/operators/fill_constant_op.cc
paddle/operators/fill_constant_op.cc
+6
-1
paddle/operators/fill_zeros_like_op.cc
paddle/operators/fill_zeros_like_op.cc
+5
-3
未找到文件。
paddle/operators/elementwise_add_op.cc
浏览文件 @
af760eac
...
...
@@ -22,7 +22,7 @@ class ElementwiseAddOpMaker : public ElementwiseOpMaker {
ElementwiseAddOpMaker
(
framework
::
OpProto
*
proto
,
framework
::
OpAttrChecker
*
op_checker
)
:
ElementwiseOpMaker
(
proto
,
op_checker
)
{
SetComment
(
"
add"
,
"Out = X + Y
"
);
SetComment
(
"
Add"
,
"$Out = X + Y$
"
);
AddComment
(
comment_
);
}
};
...
...
paddle/operators/elementwise_div_op.cc
浏览文件 @
af760eac
...
...
@@ -22,7 +22,7 @@ class ElementwiseDivOpMaker : public ElementwiseOpMaker {
ElementwiseDivOpMaker
(
framework
::
OpProto
*
proto
,
framework
::
OpAttrChecker
*
op_checker
)
:
ElementwiseOpMaker
(
proto
,
op_checker
)
{
SetComment
(
"Div"
,
"
Out = X / Y
"
);
SetComment
(
"Div"
,
"
$Out = X / Y$
"
);
AddComment
(
comment_
);
}
};
...
...
paddle/operators/elementwise_mul_op.cc
浏览文件 @
af760eac
...
...
@@ -23,7 +23,7 @@ class ElementwiseMulOpMaker : public ElementwiseOpMaker {
ElementwiseMulOpMaker
(
framework
::
OpProto
*
proto
,
framework
::
OpAttrChecker
*
op_checker
)
:
ElementwiseOpMaker
(
proto
,
op_checker
)
{
SetComment
(
"Mul"
,
"
Out = X ⊙ Y
"
);
SetComment
(
"Mul"
,
"
$Out = X
\\
odot
\\
Y$
"
);
AddComment
(
comment_
);
}
};
...
...
paddle/operators/elementwise_op.h
浏览文件 @
af760eac
...
...
@@ -46,37 +46,42 @@ class ElementwiseOpMaker : public framework::OpProtoAndCheckerMaker {
ElementwiseOpMaker
(
framework
::
OpProto
*
proto
,
framework
::
OpAttrChecker
*
op_checker
)
:
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
AddInput
(
"X"
,
R"DOC(
The first input of elementwise op, it's a tensor of any dimensions.
)DOC"
);
AddInput
(
"Y"
,
R"DOC(
The sencond input of elementwise op, it's a tensor and it's dimensions
must be small or equal to X's dimensions.
)DOC"
);
AddInput
(
"X"
,
"(Tensor) The first input tensor of elementwise op"
);
AddInput
(
"Y"
,
"(Tensor) The second input tensor of elementwise op"
);
AddOutput
(
"Out"
,
"The output of elementwise op"
);
AddAttr
<
int
>
(
"axis"
,
R"DOC(
When the shape(Y) does not equal the shape(X),Y will be broadcasted
to match the shape of X and axis should be dimension index Y in X
)DOC"
)
"(int, default -1) The starting dimension index "
"for broadcasting Y onto X"
)
.
SetDefault
(
-
1
)
.
EqualGreaterThan
(
-
1
);
AddOutput
(
"Out"
,
"The output of elementwise op"
);
comment_
=
R"DOC(
Limited elementwise {name} operator.The equation is: Out = {equation}.
1. The shape of Y should be same with X or
2. Y's shape is a subset of X.
Y will be broadcasted to match the shape of X and axis should be dimension index Y in X.
example:
shape(X) = (2, 3, 4, 5), shape(Y) = (,)
shape(X) = (2, 3, 4, 5), shape(Y) = (5,)
shape(X) = (2, 3, 4, 5), shape(Y) = (4, 5)
shape(X) = (2, 3, 4, 5), shape(Y) = (3, 4), with axis=1
shape(X) = (2, 3, 4, 5), shape(Y) = (2), with axis=0
Limited Elementwise {name} Operator.
The equation is:
{equation}
X is a tensor of any dimension and the dimensions of tensor Y must be smaller than
or equal to the dimensions of X.
There are two cases for this operator:
1. The shape of Y is same with X;
2. The shape of Y is a subset of X.
For case 2:
Y will be broadcasted to match the shape of X and axis should be
the starting dimension index for broadcasting Y onto X.
example:
shape(X) = (2, 3, 4, 5), shape(Y) = (,)
shape(X) = (2, 3, 4, 5), shape(Y) = (5,)
shape(X) = (2, 3, 4, 5), shape(Y) = (4, 5)
shape(X) = (2, 3, 4, 5), shape(Y) = (3, 4), with axis=1
shape(X) = (2, 3, 4, 5), shape(Y) = (2), with axis=0
Both the input X and Y can carry the LoD (Level of Details) information,
or not. But the output only shares the LoD with input X.
or not. But the output only shares the LoD information with input X.
)DOC"
;
AddComment
(
comment_
);
}
...
...
paddle/operators/elementwise_sub_op.cc
浏览文件 @
af760eac
...
...
@@ -22,7 +22,7 @@ class ElementwiseSubOpMaker : public ElementwiseOpMaker {
ElementwiseSubOpMaker
(
framework
::
OpProto
*
proto
,
framework
::
OpAttrChecker
*
op_checker
)
:
ElementwiseOpMaker
(
proto
,
op_checker
)
{
SetComment
(
"Sub"
,
"
Out = X - Y
"
);
SetComment
(
"Sub"
,
"
$Out = X - Y$
"
);
AddComment
(
comment_
);
}
};
...
...
paddle/operators/feed_op.cc
浏览文件 @
af760eac
...
...
@@ -59,8 +59,13 @@ class FeedOpInfoMaker : public framework::OpProtoAndCheckerMaker {
:
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
AddInput
(
"X"
,
"The input of feed op"
);
AddOutput
(
"Out"
,
"The output of feed op"
);
AddComment
(
"feed op, it should not be configured by users directly"
);
AddAttr
<
int
>
(
"col"
,
"column of feed"
);
AddAttr
<
int
>
(
"col"
,
"(int) The column of feed"
);
AddComment
(
R"DOC(
Feed Operator.
It should not be configured by users directly.
)DOC"
);
}
};
...
...
paddle/operators/fetch_op.cc
浏览文件 @
af760eac
...
...
@@ -66,8 +66,13 @@ class FetchOpInfoMaker : public framework::OpProtoAndCheckerMaker {
:
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
AddInput
(
"X"
,
"The input of fetch op"
);
AddOutput
(
"Out"
,
"The output of fetch op"
);
AddComment
(
"fetch op, it should not be configured by users directly"
);
AddAttr
<
int
>
(
"col"
,
"column of fetch"
);
AddAttr
<
int
>
(
"col"
,
"(int) The column of fetch"
);
AddComment
(
R"DOC(
Fetch Operator.
It should not be configured by users directly.
)DOC"
);
}
};
}
// namespace operators
...
...
paddle/operators/fill_constant_batch_size_like_op.cc
浏览文件 @
af760eac
...
...
@@ -70,11 +70,16 @@ class FillConstantBatchSizeLikeOpMaker
"with the specified value"
);
AddAttr
<
std
::
vector
<
int
>>
(
"shape"
,
"(vector<int>) The shape of the output"
);
AddAttr
<
int
>
(
"dim_idx"
,
"(int, default 0)
t
he index of batch size dimension"
)
"(int, default 0)
T
he index of batch size dimension"
)
.
SetDefault
(
0
);
AddAttr
<
float
>
(
"value"
,
"(float, default 0) The value to be filled"
)
.
SetDefault
(
0.0
f
);
AddComment
(
R"DOC(Fill up a variable with specified constant value.)DOC"
);
AddComment
(
R"DOC(
FillConstantBatchSizeLike Operator.
Fill up a variable with specified constant value.
)DOC"
);
}
};
}
// namespace operators
...
...
paddle/operators/fill_constant_op.cc
浏览文件 @
af760eac
...
...
@@ -54,7 +54,12 @@ class FillConstantOpMaker : public framework::OpProtoAndCheckerMaker {
AddOutput
(
"Out"
,
"(Tensor) Tensor of specified shape will be filled "
"with the specified value"
);
AddComment
(
R"DOC(Fill up a variable with specified constant value.)DOC"
);
AddComment
(
R"DOC(
FillConstantBatchSizeLike Operator.
Fill up a variable with specified constant value.
)DOC"
);
}
};
}
// namespace operators
...
...
paddle/operators/fill_zeros_like_op.cc
浏览文件 @
af760eac
...
...
@@ -37,11 +37,13 @@ class FillZerosLikeOpMaker : public framework::OpProtoAndCheckerMaker {
framework
::
OpAttrChecker
*
op_checker
)
:
framework
::
OpProtoAndCheckerMaker
(
proto
,
op_checker
)
{
AddInput
(
"X"
,
"The input of fill-zeros-like op."
);
AddOutput
(
"Y"
,
"The vari
ba
le will be filled up with zeros."
);
AddOutput
(
"Y"
,
"The vari
ab
le will be filled up with zeros."
);
AddComment
(
R"DOC(
Fill up a vriable with zeros.
FillZerosLike Operator.
Fill up a variable with zeros.
The output will have the same size as the input.
The output will have the same size with input.
)DOC"
);
}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录