Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
a249c0ca
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a249c0ca
编写于
1月 24, 2018
作者:
Y
yangyaming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refine doc and fix dtype.
上级
8314412b
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
14 addition
and
9 deletion
+14
-9
python/paddle/v2/fluid/layers/nn.py
python/paddle/v2/fluid/layers/nn.py
+14
-9
未找到文件。
python/paddle/v2/fluid/layers/nn.py
浏览文件 @
a249c0ca
...
@@ -2719,22 +2719,22 @@ def multiplex(inputs, index):
...
@@ -2719,22 +2719,22 @@ def multiplex(inputs, index):
input variables and let :math:`I_i` represents the i-th input variable and i
input variables and let :math:`I_i` represents the i-th input variable and i
is in [0, :math:`m`). All input variables are tensors with same shape
is in [0, :math:`m`). All input variables are tensors with same shape
[:math:`d_0`, :math:`d_1`, ..., :math:`d_R`]. Please note that rank of the
[:math:`d_0`, :math:`d_1`, ..., :math:`d_R`]. Please note that rank of the
input tensor should be at least 2. Each input variable will be
view
ed as a
input tensor should be at least 2. Each input variable will be
treat
ed as a
2-D matrix with shape [:math:`M`, :math:`N`] where :math:`M` for :math:`d_0`
2-D matrix with shape [:math:`M`, :math:`N`] where :math:`M` for :math:`d_0`
and :math:`N` for :math:`d_1` * :math:`d_2` * ... * :math:`d_R`. Let
and :math:`N` for :math:`d_1` * :math:`d_2` * ... * :math:`d_R`. Let
:math:`I_i[j]` be the j-th row of the i-th input variable. The given index
:math:`I_i[j]` be the j-th row of the i-th input variable. The given index
variable should be a 2-D tensor with shape [:math:`M`, 1]. Let `ID[i]` be
variable should be a 2-D tensor with shape [:math:`M`, 1]. Let `ID[i]` be
the i-th index value of
index variable. Then the output variable will be a
the i-th index value of
the index variable. Then the output variable will
tensor with shape [:math:`d_0`, :math:`d_1`, ..., :math:`d_R`]. If we view
be a tensor with shape [:math:`d_0`, :math:`d_1`, ..., :math:`d_R`]. If we
t
he output tensor as a 2-D matrix with shape [:math:`M`, :math:`N`] and let
t
reat the output tensor as a 2-D matrix with shape [:math:`M`, :math:`N`]
:math:`O[i]` be the i-th row of the matrix, then values of `O[i]` come from
and let :math:`O[i]` be the i-th row of the matrix, then `O[i]` is equal to
:math:`I_{ID[i]}[i]`.
:math:`I_{ID[i]}[i]`.
Args:
Args:
inputs (list):
Input variables which are tensors with same shape and
the
inputs (list):
A list of variables to gather from. All variables have
the
rank is at least 2.
same shape and the
rank is at least 2.
index (Variable): Tensor<int32>, index variable which is a 2-D tensor
index (Variable): Tensor<int32>, index variable which is a 2-D tensor
with shape [M, 1] where M
for
batch size.
with shape [M, 1] where M
is the
batch size.
Returns:
Returns:
Variable: Multiplex variable gathered from input variables.
Variable: Multiplex variable gathered from input variables.
...
@@ -2748,7 +2748,12 @@ def multiplex(inputs, index):
...
@@ -2748,7 +2748,12 @@ def multiplex(inputs, index):
out = fluid.layers.multiplex(inputs=[x1, x2], index=index)
out = fluid.layers.multiplex(inputs=[x1, x2], index=index)
"""
"""
helper
=
LayerHelper
(
'multiplex'
,
**
locals
())
helper
=
LayerHelper
(
'multiplex'
,
**
locals
())
out
=
helper
.
create_tmp_variable
(
helper
.
input_dtype
())
if
not
isinstance
(
inputs
,
list
)
and
len
(
inputs
)
<
2
:
raise
ValueError
(
"inputs should be a list object and contains at least "
"2 elements."
)
out
=
helper
.
create_tmp_variable
(
inputs
[
0
].
dtype
)
helper
.
append_op
(
helper
.
append_op
(
type
=
'multiplex'
,
type
=
'multiplex'
,
inputs
=
{
'X'
:
inputs
,
inputs
=
{
'X'
:
inputs
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录