Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
b40917ab
提交
b40917ab
authored
9月 09, 2013
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make the gpuarray tests run by default.
上级
47270716
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
11 行增加
和
5 行删除
+11
-5
__init__.py
theano/sandbox/gpuarray/__init__.py
+3
-4
test_basic_ops.py
theano/sandbox/gpuarray/tests/test_basic_ops.py
+8
-1
没有找到文件。
theano/sandbox/gpuarray/__init__.py
浏览文件 @
b40917ab
...
@@ -11,6 +11,7 @@ _logger.setLevel(logging.WARNING)
...
@@ -11,6 +11,7 @@ _logger.setLevel(logging.WARNING)
error
=
_logger
.
error
error
=
_logger
.
error
info
=
_logger
.
info
info
=
_logger
.
info
pygpu_activated
=
False
try
:
try
:
import
pygpu
import
pygpu
import
pygpu.gpuarray
import
pygpu.gpuarray
...
@@ -24,8 +25,10 @@ import opt
...
@@ -24,8 +25,10 @@ import opt
def
init_dev
(
dev
):
def
init_dev
(
dev
):
global
pygpu_activated
context
=
pygpu
.
init
(
dev
)
context
=
pygpu
.
init
(
dev
)
pygpu
.
set_default_context
(
context
)
pygpu
.
set_default_context
(
context
)
pygpu_activated
=
True
if
pygpu
:
if
pygpu
:
try
:
try
:
...
@@ -37,12 +40,8 @@ if pygpu:
...
@@ -37,12 +40,8 @@ if pygpu:
optdb
.
add_tags
(
'gpuarray_opt'
,
'fast_run'
,
'inplace'
)
optdb
.
add_tags
(
'gpuarray_opt'
,
'fast_run'
,
'inplace'
)
elif
config
.
gpuarray
.
init_device
!=
''
:
elif
config
.
gpuarray
.
init_device
!=
''
:
init_dev
(
config
.
gpuarray
.
init_device
)
init_dev
(
config
.
gpuarray
.
init_device
)
else
:
info
(
"pygpu support not configured, disabling"
)
pygpu
=
None
except
Exception
:
except
Exception
:
error
(
"Could not initialize pygpu, support disabled"
,
exc_info
=
True
)
error
(
"Could not initialize pygpu, support disabled"
,
exc_info
=
True
)
pygpu
=
None
else
:
else
:
if
(
config
.
gpuarray
.
init_device
!=
''
or
if
(
config
.
gpuarray
.
init_device
!=
''
or
config
.
device
.
startswith
(
'opencl'
)
or
config
.
device
.
startswith
(
'opencl'
)
or
...
...
theano/sandbox/gpuarray/tests/test_basic_ops.py
浏览文件 @
b40917ab
...
@@ -11,7 +11,14 @@ from theano.tests.unittest_tools import SkipTest
...
@@ -11,7 +11,14 @@ from theano.tests.unittest_tools import SkipTest
from
numpy.testing.noseclasses
import
KnownFailureTest
from
numpy.testing.noseclasses
import
KnownFailureTest
import
theano.sandbox.gpuarray
import
theano.sandbox.gpuarray
if
theano
.
sandbox
.
gpuarray
.
pygpu
is
None
:
import
theano.sandbox.cuda
as
cuda_ndarray
if
cuda_ndarray
.
cuda_available
and
not
theano
.
sandbox
.
gpuarray
.
pygpu_activated
:
if
not
cuda_ndarray
.
use
.
device_number
:
cuda_ndarray
.
use
(
'gpu'
)
theano
.
sandbox
.
gpuarray
.
init_dev
(
'cuda'
)
if
not
theano
.
sandbox
.
gpuarray
.
pygpu_activated
:
raise
SkipTest
(
"pygpu disabled"
)
raise
SkipTest
(
"pygpu disabled"
)
from
theano.sandbox.gpuarray.type
import
(
GpuArrayType
,
from
theano.sandbox.gpuarray.type
import
(
GpuArrayType
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论