Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
05909674
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
05909674
编写于
1月 03, 2018
作者:
Y
Yang Yu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add init glog
上级
90a5a55a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
20 addition
and
12 deletion
+20
-12
paddle/framework/init.cc
paddle/framework/init.cc
+4
-0
paddle/framework/init.h
paddle/framework/init.h
+2
-0
paddle/pybind/pybind.cc
paddle/pybind/pybind.cc
+1
-0
python/paddle/v2/fluid/__init__.py
python/paddle/v2/fluid/__init__.py
+13
-12
未找到文件。
paddle/framework/init.cc
浏览文件 @
05909674
...
@@ -75,5 +75,9 @@ bool InitDevices(const std::vector<std::string> &devices) {
...
@@ -75,5 +75,9 @@ bool InitDevices(const std::vector<std::string> &devices) {
return
true
;
return
true
;
}
}
void
InitGLOG
(
const
std
::
string
&
prog_name
)
{
google
::
InitGoogleLogging
(
prog_name
.
c_str
());
}
}
// namespace framework
}
// namespace framework
}
// namespace paddle
}
// namespace paddle
paddle/framework/init.h
浏览文件 @
05909674
...
@@ -22,6 +22,8 @@ namespace framework {
...
@@ -22,6 +22,8 @@ namespace framework {
void
InitGflags
(
std
::
vector
<
std
::
string
>
&
argv
);
void
InitGflags
(
std
::
vector
<
std
::
string
>
&
argv
);
void
InitGLOG
(
const
std
::
string
&
prog_name
);
bool
InitDevices
(
const
std
::
vector
<
std
::
string
>
&
devices
);
bool
InitDevices
(
const
std
::
vector
<
std
::
string
>
&
devices
);
}
// namespace framework
}
// namespace framework
...
...
paddle/pybind/pybind.cc
浏览文件 @
05909674
...
@@ -427,6 +427,7 @@ All parameter, weight, gradient are variables in Paddle.
...
@@ -427,6 +427,7 @@ All parameter, weight, gradient are variables in Paddle.
m
.
def
(
"unique_integer"
,
UniqueIntegerGenerator
);
m
.
def
(
"unique_integer"
,
UniqueIntegerGenerator
);
m
.
def
(
"init_gflags"
,
framework
::
InitGflags
);
m
.
def
(
"init_gflags"
,
framework
::
InitGflags
);
m
.
def
(
"init_glog"
,
framework
::
InitGLOG
);
m
.
def
(
"init_devices"
,
&
framework
::
InitDevices
);
m
.
def
(
"init_devices"
,
&
framework
::
InitDevices
);
m
.
def
(
"is_compile_gpu"
,
IsCompileGPU
);
m
.
def
(
"is_compile_gpu"
,
IsCompileGPU
);
...
...
python/paddle/v2/fluid/__init__.py
浏览文件 @
05909674
# import all class inside framework into fluid module
# import all class inside framework into fluid module
import
framework
from
core
import
LoDTensor
from
framework
import
*
# import all class inside executor into fluid module
import
executor
from
executor
import
*
import
io
import
backward
import
clip
import
evaluator
import
evaluator
# import all class inside executor into fluid module
import
executor
import
framework
import
initializer
import
initializer
import
io
import
layers
import
layers
import
nets
import
nets
import
optimizer
import
optimizer
import
backward
import
regularizer
import
regularizer
from
param_attr
import
ParamAttr
from
data_feeder
import
DataFeeder
from
data_feeder
import
DataFeeder
from
core
import
LoDTensor
,
CPUPlace
,
CUDAPlace
from
distribute_transpiler
import
DistributeTranspiler
from
distribute_transpiler
import
DistributeTranspiler
import
clip
from
executor
import
*
from
framework
import
*
from
param_attr
import
ParamAttr
Tensor
=
LoDTensor
Tensor
=
LoDTensor
__all__
=
framework
.
__all__
+
executor
.
__all__
+
[
__all__
=
framework
.
__all__
+
executor
.
__all__
+
[
...
@@ -27,7 +27,7 @@ __all__ = framework.__all__ + executor.__all__ + [
...
@@ -27,7 +27,7 @@ __all__ = framework.__all__ + executor.__all__ + [
]
]
def
__
read_gflags_from_env
__
():
def
__
bootstrap
__
():
"""
"""
Enable reading gflags from environment variables.
Enable reading gflags from environment variables.
...
@@ -41,6 +41,7 @@ def __read_gflags_from_env__():
...
@@ -41,6 +41,7 @@ def __read_gflags_from_env__():
read_env_flags
.
append
(
'fraction_of_gpu_memory_to_use'
)
read_env_flags
.
append
(
'fraction_of_gpu_memory_to_use'
)
core
.
init_gflags
([
sys
.
argv
[
0
]]
+
core
.
init_gflags
([
sys
.
argv
[
0
]]
+
[
"--tryfromenv="
+
","
.
join
(
read_env_flags
)])
[
"--tryfromenv="
+
","
.
join
(
read_env_flags
)])
core
.
init_glog
(
sys
.
argv
[
0
])
if
core
.
is_compile_gpu
():
if
core
.
is_compile_gpu
():
core
.
init_devices
([
"CPU"
,
"GPU:0"
])
core
.
init_devices
([
"CPU"
,
"GPU:0"
])
...
@@ -48,4 +49,4 @@ def __read_gflags_from_env__():
...
@@ -48,4 +49,4 @@ def __read_gflags_from_env__():
core
.
init_devices
([
"CPU"
])
core
.
init_devices
([
"CPU"
])
__
read_gflags_from_env
__
()
__
bootstrap
__
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录