Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
f2897222
提交
f2897222
authored
2月 20, 2012
作者:
nouiz
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #458 from delallea/fix_disable_cuda
Fix when forcing cuda to be disabled
上级
a65238e3
2b9ba848
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
29 行增加
和
18 行删除
+29
-18
__init__.py
theano/sandbox/cuda/__init__.py
+25
-1
basic_ops.py
theano/sandbox/cuda/basic_ops.py
+0
-12
multinomial.py
theano/sandbox/multinomial.py
+2
-2
rng_mrg.py
theano/sandbox/rng_mrg.py
+2
-3
没有找到文件。
theano/sandbox/cuda/__init__.py
浏览文件 @
f2897222
...
...
@@ -162,6 +162,30 @@ from theano.sandbox.cuda.var import (CudaNdarrayVariable,
float32_shared_constructor
)
from
theano.sandbox.cuda.type
import
CudaNdarrayType
class
GpuOp
(
theano
.
gof
.
Op
):
"""
Parent class for all GPU Ops.
This class ensures we verify the GPU is working properly when a GPU Op is
used for the first time.
It is defined in __init__.py so that it exists even when `cuda_available`
is False (this is necessary to avoid breaking the test suite).
"""
def
make_thunk
(
self
,
node
,
storage_map
,
compute_map
,
no_recycling
):
if
theano
.
sandbox
.
cuda
.
use
.
device_number
is
None
:
theano
.
sandbox
.
cuda
.
use
(
"gpu"
,
force
=
True
,
default_to_move_computation_to_gpu
=
False
,
move_shared_float32_to_gpu
=
False
,
enable_cuda
=
False
)
return
super
(
GpuOp
,
self
)
.
make_thunk
(
node
,
storage_map
,
compute_map
,
no_recycling
)
if
cuda_available
:
# check if their is an old cuda_ndarray that was loading instead of the one
# we compiled!
...
...
@@ -178,7 +202,7 @@ if cuda_available:
shared_constructor
=
float32_shared_constructor
import
basic_ops
from
basic_ops
import
(
Gpu
Op
,
Gpu
FromHost
,
HostFromGpu
,
GpuElemwise
,
from
basic_ops
import
(
GpuFromHost
,
HostFromGpu
,
GpuElemwise
,
GpuDimShuffle
,
GpuSum
,
GpuReshape
,
GpuContiguous
,
GpuSubtensor
,
GpuIncSubtensor
,
GpuAdvancedSubtensor1
,
GpuAdvancedIncSubtensor1
,
...
...
theano/sandbox/cuda/basic_ops.py
浏览文件 @
f2897222
...
...
@@ -34,18 +34,6 @@ def as_cuda_array(obj):
raise
TypeError
(
"Don't know how to cast to a CudaNdarray object"
)
class
GpuOp
(
Op
):
def
make_thunk
(
self
,
node
,
storage_map
,
compute_map
,
no_recycling
):
if
theano
.
sandbox
.
cuda
.
use
.
device_number
is
None
:
theano
.
sandbox
.
cuda
.
use
(
"gpu"
,
force
=
True
,
default_to_move_computation_to_gpu
=
False
,
move_shared_float32_to_gpu
=
False
,
enable_cuda
=
False
)
return
super
(
GpuOp
,
self
)
.
make_thunk
(
node
,
storage_map
,
compute_map
,
no_recycling
)
class
HostFromGpu
(
GpuOp
):
"""
Implement the transfer from gpu to the cpu.
...
...
theano/sandbox/multinomial.py
浏览文件 @
f2897222
...
...
@@ -3,9 +3,9 @@ from theano import Op, Apply
import
theano.tensor
as
T
from
theano.gof
import
local_optimizer
from
theano.sandbox.cuda
import
cuda_available
from
theano.sandbox.cuda
import
cuda_available
,
GpuOp
if
cuda_available
:
from
theano.sandbox.cuda
import
CudaNdarrayType
,
GpuOp
from
theano.sandbox.cuda
import
CudaNdarrayType
from
theano.sandbox.cuda.basic_ops
import
host_from_gpu
,
gpu_from_host
from
theano.sandbox.cuda.opt
import
register_opt
...
...
theano/sandbox/rng_mrg.py
浏览文件 @
f2897222
...
...
@@ -18,11 +18,10 @@ from theano.gof.python25 import all
import
multinomial
from
theano.sandbox.cuda
import
cuda_available
,
cuda_enabled
from
theano.sandbox.cuda
import
cuda_available
,
cuda_enabled
,
GpuOp
if
cuda_available
:
from
theano.sandbox.cuda
import
(
CudaNdarrayType
,
float32_shared_constructor
,
GpuOp
)
float32_shared_constructor
)
def
mulmod
(
a
,
b
,
c
,
m
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论