Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
0af21f1d
提交
0af21f1d
authored
9月 30, 2015
作者:
Arnaud Bergeron
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Delete gpuarray.init_device and use init_gpu_device like everyone else.
上级
49b55484
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
14 行增加
和
26 行删除
+14
-26
__init__.py
theano/__init__.py
+4
-2
configdefaults.py
theano/configdefaults.py
+4
-17
__init__.py
theano/sandbox/cuda/__init__.py
+1
-4
__init__.py
theano/sandbox/gpuarray/__init__.py
+5
-3
没有找到文件。
theano/__init__.py
浏览文件 @
0af21f1d
...
@@ -109,8 +109,10 @@ if config.device.startswith('gpu') or config.init_gpu_device.startswith('gpu'):
...
@@ -109,8 +109,10 @@ if config.device.startswith('gpu') or config.init_gpu_device.startswith('gpu'):
theano
.
sandbox
.
cuda
.
tests
.
test_driver
.
test_nvidia_driver1
()
theano
.
sandbox
.
cuda
.
tests
.
test_driver
.
test_nvidia_driver1
()
if
config
.
device
.
startswith
(
'cuda'
)
or
config
.
device
.
startswith
(
'opencl'
)
or
\
if
(
config
.
device
.
startswith
(
'cuda'
)
or
config
.
gpuarray
.
init_device
!=
''
:
config
.
device
.
startswith
(
'opencl'
)
or
config
.
init_gpu_device
.
startswith
(
'cuda'
)
or
config
.
init_gpu_device
.
startswith
(
'opencl'
)):
import
theano.sandbox.gpuarray
import
theano.sandbox.gpuarray
# Use config.numpy to call numpy.seterr
# Use config.numpy to call numpy.seterr
...
...
theano/configdefaults.py
浏览文件 @
0af21f1d
...
@@ -73,19 +73,19 @@ class DeviceParam(ConfigParam):
...
@@ -73,19 +73,19 @@ class DeviceParam(ConfigParam):
self
.
default
=
default
self
.
default
=
default
def
filter
(
val
):
def
filter
(
val
):
if
val
.
startswith
(
'cpu'
)
or
val
.
startswith
(
'gpu'
)
\
if
val
==
self
.
default
or
val
.
startswith
(
'gpu'
)
\
or
val
.
startswith
(
'opencl'
)
or
val
.
startswith
(
'cuda'
):
or
val
.
startswith
(
'opencl'
)
or
val
.
startswith
(
'cuda'
):
return
val
return
val
else
:
else
:
raise
ValueError
((
'Invalid value ("
%
s") for configuration '
raise
ValueError
((
'Invalid value ("
%
s") for configuration '
'variable "
%
s". Valid options start with '
'variable "
%
s". Valid options start with '
'one of "
cpu", "
gpu", "opencl", "cuda"'
'one of "gpu", "opencl", "cuda"'
%
(
val
,
self
.
fullname
)))
%
(
val
,
self
.
fullname
)))
over
=
kwargs
.
get
(
"allow_override"
,
True
)
over
=
kwargs
.
get
(
"allow_override"
,
True
)
super
(
DeviceParam
,
self
)
.
__init__
(
default
,
filter
,
over
)
super
(
DeviceParam
,
self
)
.
__init__
(
default
,
filter
,
over
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'
%
s (
cpu, gpu*, opencl*, cuda*) '
%
(
self
.
fullname
,
)
return
'
%
s (
gpu*, opencl*, cuda*) '
%
(
self
.
fullname
,
self
.
default
)
AddConfigVar
(
AddConfigVar
(
'device'
,
'device'
,
...
@@ -94,14 +94,6 @@ AddConfigVar(
...
@@ -94,14 +94,6 @@ AddConfigVar(
"on it. Do not use upper case letters, only lower case even if "
"on it. Do not use upper case letters, only lower case even if "
"NVIDIA use capital letters."
),
"NVIDIA use capital letters."
),
DeviceParam
(
'cpu'
,
allow_override
=
False
),
DeviceParam
(
'cpu'
,
allow_override
=
False
),
in_c_key
=
False
,)
AddConfigVar
(
'gpuarray.init_device'
,
"""
Device to initialize for gpuarray use without moving
computations automatically.
"""
,
StrParam
(
''
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
AddConfigVar
(
...
@@ -110,12 +102,7 @@ AddConfigVar(
...
@@ -110,12 +102,7 @@ AddConfigVar(
"Unlike 'device', setting this option will NOT move computations, "
"Unlike 'device', setting this option will NOT move computations, "
"nor shared variables, to the specified GPU. "
"nor shared variables, to the specified GPU. "
"It can be used to run GPU-specific tests on a particular GPU."
),
"It can be used to run GPU-specific tests on a particular GPU."
),
EnumStr
(
''
,
'gpu'
,
DeviceParam
(
''
,
allow_override
=
False
),
'gpu0'
,
'gpu1'
,
'gpu2'
,
'gpu3'
,
'gpu4'
,
'gpu5'
,
'gpu6'
,
'gpu7'
,
'gpu8'
,
'gpu9'
,
'gpu10'
,
'gpu11'
,
'gpu12'
,
'gpu13'
,
'gpu14'
,
'gpu15'
,
allow_override
=
False
),
in_c_key
=
False
)
in_c_key
=
False
)
AddConfigVar
(
AddConfigVar
(
...
...
theano/sandbox/cuda/__init__.py
浏览文件 @
0af21f1d
...
@@ -535,10 +535,7 @@ def handle_shared_float32(tf):
...
@@ -535,10 +535,7 @@ def handle_shared_float32(tf):
# import dependency. So we also test it in the file theano/__init__.py
# import dependency. So we also test it in the file theano/__init__.py
if
config
.
device
.
startswith
(
'gpu'
):
if
config
.
device
.
startswith
(
'gpu'
):
use
(
device
=
config
.
device
,
force
=
config
.
force_device
,
test_driver
=
False
)
use
(
device
=
config
.
device
,
force
=
config
.
force_device
,
test_driver
=
False
)
elif
config
.
init_gpu_device
:
elif
config
.
init_gpu_device
.
startswith
(
'gpu'
):
assert
config
.
device
==
"cpu"
,
(
"We can use the Theano flag init_gpu_device"
" only when the Theano flag device=='cpu'"
)
_logger
.
warning
((
"GPU device
%
s will be initialized, and used if a GPU is "
_logger
.
warning
((
"GPU device
%
s will be initialized, and used if a GPU is "
"needed. "
"needed. "
"However, no computation, nor shared variables, will be implicitly "
"However, no computation, nor shared variables, will be implicitly "
...
...
theano/sandbox/gpuarray/__init__.py
浏览文件 @
0af21f1d
...
@@ -57,8 +57,9 @@ if pygpu:
...
@@ -57,8 +57,9 @@ if pygpu:
import
theano.compile
import
theano.compile
theano
.
compile
.
shared_constructor
(
gpuarray_shared_constructor
)
theano
.
compile
.
shared_constructor
(
gpuarray_shared_constructor
)
optdb
.
add_tags
(
'gpuarray_opt'
,
'fast_run'
,
'fast_compile'
)
optdb
.
add_tags
(
'gpuarray_opt'
,
'fast_run'
,
'fast_compile'
)
elif
config
.
gpuarray
.
init_device
!=
''
:
elif
(
config
.
init_gpu_device
.
startswith
(
'cuda'
)
or
init_dev
(
config
.
gpuarray
.
init_device
)
config
.
init_gpu_device
.
startswith
(
'opencl'
)):
init_dev
(
config
.
init_gpu_device
)
from
.basic_ops
import
(
GpuAlloc
,
GpuContiguous
,
GpuEye
,
GpuFromHost
,
from
.basic_ops
import
(
GpuAlloc
,
GpuContiguous
,
GpuEye
,
GpuFromHost
,
GpuJoin
,
GpuReshape
,
GpuSplit
,
HostFromGpu
)
GpuJoin
,
GpuReshape
,
GpuSplit
,
HostFromGpu
)
...
@@ -70,7 +71,8 @@ if pygpu:
...
@@ -70,7 +71,8 @@ if pygpu:
except
Exception
:
except
Exception
:
error
(
"Could not initialize pygpu, support disabled"
,
exc_info
=
True
)
error
(
"Could not initialize pygpu, support disabled"
,
exc_info
=
True
)
else
:
else
:
if
(
config
.
gpuarray
.
init_device
!=
''
or
if
(
config
.
init_gpu_device
.
startswith
(
'cuda'
)
or
config
.
init_gpu_device
.
startswith
(
'opencl'
)
or
config
.
device
.
startswith
(
'opencl'
)
or
config
.
device
.
startswith
(
'opencl'
)
or
config
.
device
.
startswith
(
'cuda'
)):
config
.
device
.
startswith
(
'cuda'
)):
error
(
"pygpu was configured but could not be imported"
,
exc_info
=
True
)
error
(
"pygpu was configured but could not be imported"
,
exc_info
=
True
)
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论