Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
f6f06924
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
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看板
提交
f6f06924
编写于
11月 26, 2018
作者:
X
Xin Pan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean up
test=develop
上级
0318c951
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
3 addition
and
15 deletion
+3
-15
paddle/fluid/pybind/pybind.cc
paddle/fluid/pybind/pybind.cc
+0
-1
python/paddle/fluid/framework.py
python/paddle/fluid/framework.py
+2
-6
python/paddle/fluid/imperative/layers.py
python/paddle/fluid/imperative/layers.py
+1
-1
python/paddle/fluid/layer_helper.py
python/paddle/fluid/layer_helper.py
+0
-7
未找到文件。
paddle/fluid/pybind/pybind.cc
浏览文件 @
f6f06924
...
@@ -159,7 +159,6 @@ PYBIND11_MODULE(core, m) {
...
@@ -159,7 +159,6 @@ PYBIND11_MODULE(core, m) {
self
.
mutable_data
<
float
>
(
place
);
self
.
mutable_data
<
float
>
(
place
);
})
})
.
def
(
"set"
,
PyCPUTensorSetFromArray
<
float
>
)
.
def
(
"set"
,
PyCPUTensorSetFromArray
<
float
>
)
.
def
(
"set_float"
,
PyCPUTensorSetFromArray
<
float
>
)
.
def
(
"set"
,
PyCPUTensorSetFromArray
<
int
>
)
.
def
(
"set"
,
PyCPUTensorSetFromArray
<
int
>
)
.
def
(
"set"
,
PyCPUTensorSetFromArray
<
double
>
)
.
def
(
"set"
,
PyCPUTensorSetFromArray
<
double
>
)
.
def
(
"set"
,
PyCPUTensorSetFromArray
<
int64_t
>
)
.
def
(
"set"
,
PyCPUTensorSetFromArray
<
int64_t
>
)
...
...
python/paddle/fluid/framework.py
浏览文件 @
f6f06924
...
@@ -283,15 +283,11 @@ class Variable(core.VariableBase):
...
@@ -283,15 +283,11 @@ class Variable(core.VariableBase):
name
=
unique_name
.
generate
(
'_generated_var'
)
name
=
unique_name
.
generate
(
'_generated_var'
)
is_new_var
=
False
is_new_var
=
False
name
=
cpt
.
to_text
(
name
)
name
=
cpt
.
to_text
(
name
)
desc
=
self
.
block
.
desc
.
find_var
(
cpt
.
to_bytes
(
name
))
self
.
desc
=
self
.
block
.
desc
.
find_var
(
cpt
.
to_bytes
(
name
))
if
desc
is
None
:
if
self
.
desc
is
None
:
# sys.stderr.write('desc is None\n')
self
.
desc
=
self
.
block
.
desc
.
var
(
cpt
.
to_bytes
(
name
))
self
.
desc
=
self
.
block
.
desc
.
var
(
cpt
.
to_bytes
(
name
))
is_new_var
=
True
is_new_var
=
True
else
:
# sys.stderr.write('found var %s %s' % (name, self.desc))
self
.
desc
=
desc
if
is_new_var
:
if
is_new_var
:
self
.
desc
.
set_type
(
type
)
self
.
desc
.
set_type
(
type
)
...
...
python/paddle/fluid/imperative/layers.py
浏览文件 @
f6f06924
...
@@ -54,7 +54,7 @@ class PyLayer(core.Layer):
...
@@ -54,7 +54,7 @@ class PyLayer(core.Layer):
dtype
=
x
.
dtype
)
dtype
=
x
.
dtype
)
var
=
self
.
_scope
.
var
(
py_var
.
name
)
var
=
self
.
_scope
.
var
(
py_var
.
name
)
tensor
=
var
.
get_tensor
()
tensor
=
var
.
get_tensor
()
tensor
.
set
_float
(
x
,
core
.
CPUPlace
())
tensor
.
set
(
x
,
core
.
CPUPlace
())
var_inputs
.
append
(
py_var
)
var_inputs
.
append
(
py_var
)
elif
isinstance
(
x
,
framework
.
Variable
):
elif
isinstance
(
x
,
framework
.
Variable
):
var_inputs
.
append
(
x
)
var_inputs
.
append
(
x
)
...
...
python/paddle/fluid/layer_helper.py
浏览文件 @
f6f06924
...
@@ -50,7 +50,6 @@ class LayerHelper(object):
...
@@ -50,7 +50,6 @@ class LayerHelper(object):
def
_np_to_variable
(
self
,
x
):
def
_np_to_variable
(
self
,
x
):
tensor
=
core
.
LoDTensor
()
tensor
=
core
.
LoDTensor
()
sys
.
stderr
.
write
(
'%s %s
\n
'
%
(
tensor
,
x
))
tensor
.
set
(
x
,
core
.
CPUPlace
())
tensor
.
set
(
x
,
core
.
CPUPlace
())
return
Variable
(
return
Variable
(
self
.
main_program
.
current_block
(),
self
.
main_program
.
current_block
(),
...
@@ -67,12 +66,6 @@ class LayerHelper(object):
...
@@ -67,12 +66,6 @@ class LayerHelper(object):
else
:
else
:
raise
ValueError
(
"inputs wrong type %s
\n
"
%
x
)
raise
ValueError
(
"inputs wrong type %s
\n
"
%
x
)
def
to_variables
(
self
,
inputs
):
if
isinstance
(
inputs
,
list
)
or
isinstance
(
inputs
,
tuple
):
return
[
self
.
_to_variable
(
x
)
for
x
in
inputs
]
else
:
return
[
self
.
_to_variable
(
inputs
)]
def
append_op
(
self
,
*
args
,
**
kwargs
):
def
append_op
(
self
,
*
args
,
**
kwargs
):
return
self
.
main_program
.
current_block
().
append_op
(
*
args
,
**
kwargs
)
return
self
.
main_program
.
current_block
().
append_op
(
*
args
,
**
kwargs
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录