Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
190a8767
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
190a8767
编写于
4月 07, 2020
作者:
Z
zhongpu
提交者:
GitHub
4月 07, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix if logic for similarity_net, test=develop (#4517)
上级
923d11fd
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
4 addition
and
4 deletion
+4
-4
dygraph/similarity_net/nets/paddle_layers.py
dygraph/similarity_net/nets/paddle_layers.py
+4
-4
未找到文件。
dygraph/similarity_net/nets/paddle_layers.py
浏览文件 @
190a8767
...
...
@@ -556,7 +556,7 @@ class FC(Layer):
outputs
=
{
"Out"
:
pre_bias
},
attrs
=
{
"use_mkldnn"
:
False
})
if
self
.
_b
:
if
self
.
_b
is
not
None
:
pre_activation
=
self
.
_helper
.
create_variable_for_type_inference
(
dtype
=
self
.
_dtype
)
self
.
_helper
.
append_op
(
...
...
@@ -863,7 +863,7 @@ class RNN(Layer):
lambda
x
:
fluid
.
layers
.
transpose
(
x
,
[
1
,
0
]
+
list
(
range
(
2
,
len
(
x
.
shape
)))),
inputs
)
if
sequence_length
:
if
sequence_length
is
not
None
:
mask
=
fluid
.
layers
.
sequence_mask
(
sequence_length
,
maxlen
=
time_steps
,
...
...
@@ -872,14 +872,14 @@ class RNN(Layer):
if
self
.
is_reverse
:
inputs
=
map_structure
(
lambda
x
:
fluid
.
layers
.
reverse
(
x
,
axis
=
[
0
]),
inputs
)
mask
=
fluid
.
layers
.
reverse
(
mask
,
axis
=
[
0
])
if
sequence_length
else
None
mask
=
fluid
.
layers
.
reverse
(
mask
,
axis
=
[
0
])
if
sequence_length
is
not
None
else
None
states
=
initial_states
outputs
=
[]
for
i
in
range
(
time_steps
):
step_inputs
=
map_structure
(
lambda
x
:
x
[
i
],
inputs
)
step_outputs
,
new_states
=
self
.
cell
(
step_inputs
,
states
,
**
kwargs
)
if
sequence_length
:
if
sequence_length
is
not
None
:
new_states
=
map_structure
(
partial
(
_maybe_copy
,
step_mask
=
mask
[
i
]),
states
,
new_states
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录