Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
ca4d528b
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ca4d528b
编写于
6月 12, 2018
作者:
T
Tao Luo
提交者:
GitHub
6月 12, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11369 from luotao1/refine_doc
refine docs of elementwise_op etc.
上级
5100c4c3
c4c78733
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
15 deletion
+16
-15
paddle/fluid/operators/elementwise_op.h
paddle/fluid/operators/elementwise_op.h
+14
-13
python/paddle/fluid/layers/nn.py
python/paddle/fluid/layers/nn.py
+2
-2
未找到文件。
paddle/fluid/operators/elementwise_op.h
浏览文件 @
ca4d528b
...
...
@@ -66,40 +66,41 @@ class ElementwiseOpMaker : public framework::OpProtoAndCheckerMaker {
.
SetDefault
(
-
1
)
.
EqualGreaterThan
(
-
1
);
AddComment
(
string
::
Sprintf
(
R"DOC(
Limited Elementwise %s Operator
.
Limited Elementwise %s Operator
The equation is:
$$%s$$
$X$ is a tensor of any dimension and the dimensions of tensor $Y$ must be
smaller
than or equal to the dimensions of $X$.
- $X$: a tensor of any dimension.
- $Y$: a tensor whose dimensions must be less
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 congiguous subsequencet of $X$. The trailing dimensions
of size 1 for $Y$ will be ignored for the consideration of subsequence.
1. The shape of $Y$ is the same with $X$.
2. The shape of $Y$ is a continuous subsequence of $X$.
For case 2:
$Y$ will be broadcasted to match the shape of $X$ and axis should be
set to index of the start dimension to broadcast $Y$ onto $X$.
1. Broadcast $Y$ to match the shape of $X$, where $axis$ is the start dimension index
for broadcasting $Y$ onto $X$.
2. If $axis$ is -1 (default), $axis = rank(X) - rank(Y)$.
3. The trailing dimensions of size 1 for $Y$ will be ignored for the consideration of
subsequence, such as shape(Y) = (2, 1) => (2).
If axis is -1, it is treated as axis=rank(X)-rank(Y).
For example:
For example
.. code-block:: python
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) = (4, 5)
, with axis=-1(default) or axis=2
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
shape(X) = (2, 3, 4, 5), shape(Y) = (2, 1), with axis=0
Either of the inputs $X$ and $Y$ or none can carry the LoD (Level of Details)
information. However, the output only shares the LoD information with
input $X$.
The inputs $X$ and $Y$ can carry the different LoD information.
But the output only shares the LoD information with the
input $X$.
)DOC"
,
GetName
(),
GetEquation
()));
...
...
python/paddle/fluid/layers/nn.py
浏览文件 @
ca4d528b
...
...
@@ -1445,7 +1445,7 @@ def sequence_pool(input, pool_type):
def
sequence_first_step
(
input
):
"""
This func
iton get
the first step of sequence.
This func
tion gets
the first step of sequence.
.. code-block:: text
...
...
@@ -1478,7 +1478,7 @@ def sequence_first_step(input):
def
sequence_last_step
(
input
):
"""
This func
iton get
the last step of sequence.
This func
tion gets
the last step of sequence.
.. code-block:: text
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录