Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
88424899
M
models
项目概览
PaddlePaddle
/
models
接近 2 年 前同步成功
通知
230
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看板
提交
88424899
编写于
8月 13, 2018
作者:
L
luotao1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug after high get_places and get_dims
上级
92e04896
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
5 addition
and
5 deletion
+5
-5
fluid/DeepASR/data_utils/util.py
fluid/DeepASR/data_utils/util.py
+1
-1
fluid/DeepASR/model_utils/model.py
fluid/DeepASR/model_utils/model.py
+1
-1
fluid/language_model/train_on_cloud.py
fluid/language_model/train_on_cloud.py
+1
-1
fluid/sequence_tagging_for_ner/network_conf.py
fluid/sequence_tagging_for_ner/network_conf.py
+1
-1
fluid/text_classification/train.py
fluid/text_classification/train.py
+1
-1
未找到文件。
fluid/DeepASR/data_utils/util.py
浏览文件 @
88424899
...
@@ -28,7 +28,7 @@ def to_lodtensor(data, place):
...
@@ -28,7 +28,7 @@ def to_lodtensor(data, place):
def
lodtensor_to_ndarray
(
lod_tensor
):
def
lodtensor_to_ndarray
(
lod_tensor
):
"""conver lodtensor to ndarray
"""conver lodtensor to ndarray
"""
"""
dims
=
lod_tensor
.
get_dims
()
dims
=
lod_tensor
.
_
get_dims
()
ret
=
np
.
zeros
(
shape
=
dims
).
astype
(
'float32'
)
ret
=
np
.
zeros
(
shape
=
dims
).
astype
(
'float32'
)
for
i
in
xrange
(
np
.
product
(
dims
)):
for
i
in
xrange
(
np
.
product
(
dims
)):
ret
.
ravel
()[
i
]
=
lod_tensor
.
get_float_element
(
i
)
ret
.
ravel
()[
i
]
=
lod_tensor
.
get_float_element
(
i
)
...
...
fluid/DeepASR/model_utils/model.py
浏览文件 @
88424899
...
@@ -88,7 +88,7 @@ def stacked_lstmp_model(frame_dim,
...
@@ -88,7 +88,7 @@ def stacked_lstmp_model(frame_dim,
# When the execution place is specified to CUDAPlace, the program will
# When the execution place is specified to CUDAPlace, the program will
# run on all $CUDA_VISIBLE_DEVICES GPUs. Otherwise the program will
# run on all $CUDA_VISIBLE_DEVICES GPUs. Otherwise the program will
# run on all CPU devices.
# run on all CPU devices.
places
=
fluid
.
layers
.
get_places
()
places
=
fluid
.
layers
.
device
.
get_places
()
pd
=
fluid
.
layers
.
ParallelDo
(
places
)
pd
=
fluid
.
layers
.
ParallelDo
(
places
)
with
pd
.
do
():
with
pd
.
do
():
feat_
=
pd
.
read_input
(
feature
)
feat_
=
pd
.
read_input
(
feature
)
...
...
fluid/language_model/train_on_cloud.py
浏览文件 @
88424899
...
@@ -187,7 +187,7 @@ def do_train(train_reader,
...
@@ -187,7 +187,7 @@ def do_train(train_reader,
init_low_bound
,
init_high_bound
)
init_low_bound
,
init_high_bound
)
avg_cost
=
fluid
.
layers
.
mean
(
x
=
cost
)
avg_cost
=
fluid
.
layers
.
mean
(
x
=
cost
)
else
:
else
:
places
=
fluid
.
layers
.
get_places
()
places
=
fluid
.
layers
.
device
.
get_places
()
pd
=
fluid
.
layers
.
ParallelDo
(
places
)
pd
=
fluid
.
layers
.
ParallelDo
(
places
)
with
pd
.
do
():
with
pd
.
do
():
cost
=
network
(
cost
=
network
(
...
...
fluid/sequence_tagging_for_ner/network_conf.py
浏览文件 @
88424899
...
@@ -109,7 +109,7 @@ def ner_net(word_dict_len, label_dict_len, parallel, stack_num=2):
...
@@ -109,7 +109,7 @@ def ner_net(word_dict_len, label_dict_len, parallel, stack_num=2):
name
=
"target"
,
shape
=
[
1
],
dtype
=
'int64'
,
lod_level
=
1
)
name
=
"target"
,
shape
=
[
1
],
dtype
=
'int64'
,
lod_level
=
1
)
if
parallel
:
if
parallel
:
places
=
fluid
.
layers
.
get_places
()
places
=
fluid
.
layers
.
device
.
get_places
()
pd
=
fluid
.
layers
.
ParallelDo
(
places
)
pd
=
fluid
.
layers
.
ParallelDo
(
places
)
with
pd
.
do
():
with
pd
.
do
():
word_
=
pd
.
read_input
(
word
)
word_
=
pd
.
read_input
(
word
)
...
...
fluid/text_classification/train.py
浏览文件 @
88424899
...
@@ -34,7 +34,7 @@ def train(train_reader,
...
@@ -34,7 +34,7 @@ def train(train_reader,
if
not
parallel
:
if
not
parallel
:
cost
,
acc
,
prediction
=
network
(
data
,
label
,
len
(
word_dict
))
cost
,
acc
,
prediction
=
network
(
data
,
label
,
len
(
word_dict
))
else
:
else
:
places
=
fluid
.
layers
.
get_places
(
device_count
=
2
)
places
=
fluid
.
layers
.
device
.
get_places
(
device_count
=
2
)
pd
=
fluid
.
layers
.
ParallelDo
(
places
)
pd
=
fluid
.
layers
.
ParallelDo
(
places
)
with
pd
.
do
():
with
pd
.
do
():
cost
,
acc
,
prediction
=
network
(
cost
,
acc
,
prediction
=
network
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录