Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
a295bcef
提交
a295bcef
authored
12月 02, 2016
作者:
Thomas George
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
removed solve op lifter from sandbox/cuda as it is now in gpuarray
上级
f8ba9bb1
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
4 行增加
和
33 行删除
+4
-33
opt.py
theano/gpuarray/opt.py
+4
-2
opt.py
theano/sandbox/cuda/opt.py
+0
-31
没有找到文件。
theano/gpuarray/opt.py
浏览文件 @
a295bcef
...
@@ -69,7 +69,7 @@ from .subtensor import (GpuIncSubtensor, GpuSubtensor,
...
@@ -69,7 +69,7 @@ from .subtensor import (GpuIncSubtensor, GpuSubtensor,
GpuAdvancedIncSubtensor1_dev20
)
GpuAdvancedIncSubtensor1_dev20
)
from
.opt_util
import
alpha_merge
,
output_merge
,
pad_dims
,
unpad_dims
from
.opt_util
import
alpha_merge
,
output_merge
,
pad_dims
,
unpad_dims
from
.reduction
import
GpuMaxAndArgmax
from
.reduction
import
GpuMaxAndArgmax
from
.linalg
import
GpuCusolverSolve
from
.linalg
import
(
GpuCusolverSolve
,
cusolver_available
)
_logger
=
logging
.
getLogger
(
"theano.gpuarray.opt"
)
_logger
=
logging
.
getLogger
(
"theano.gpuarray.opt"
)
...
@@ -1889,9 +1889,11 @@ def local_gpu_maxandargmax(op, context_name, inputs, outputs):
...
@@ -1889,9 +1889,11 @@ def local_gpu_maxandargmax(op, context_name, inputs, outputs):
# solve
# solve
@register_opt
(
'fast_compile'
)
@register_opt
(
'fast_compile'
)
@op_lifter
([
theano
.
tensor
.
slinalg
.
Solve
])
@op_lifter
([
slinalg
.
Solve
])
@register_opt2
([
theano
.
tensor
.
slinalg
.
Solve
],
'fast_compile'
)
@register_opt2
([
theano
.
tensor
.
slinalg
.
Solve
],
'fast_compile'
)
def
local_gpu_solve
(
op
,
context_name
,
inputs
,
outputs
):
def
local_gpu_solve
(
op
,
context_name
,
inputs
,
outputs
):
if
not
cusolver_available
:
return
return
GpuCusolverSolve
()
return
GpuCusolverSolve
()
# Do not register in fast_run or fast_compile.
# Do not register in fast_run or fast_compile.
...
...
theano/sandbox/cuda/opt.py
浏览文件 @
a295bcef
...
@@ -49,7 +49,6 @@ from theano.sandbox.cuda.blas import (
...
@@ -49,7 +49,6 @@ from theano.sandbox.cuda.blas import (
GpuCorr3dMM
,
GpuCorr3dMM_gradInputs
,
GpuCorr3dMM_gradWeights
)
GpuCorr3dMM
,
GpuCorr3dMM_gradInputs
,
GpuCorr3dMM_gradWeights
)
from
theano.sandbox.cuda.blas
import
gpu_gemv_inplace
from
theano.sandbox.cuda.blas
import
gpu_gemv_inplace
from
theano.sandbox.cuda.cusolver
import
gpu_solve
from
theano.sandbox.cuda.blas
import
gpu_gemv_no_inplace
from
theano.sandbox.cuda.blas
import
gpu_gemv_no_inplace
from
theano.sandbox.cuda.blas
import
gpu_ger_inplace
from
theano.sandbox.cuda.blas
import
gpu_ger_inplace
...
@@ -700,36 +699,6 @@ def local_gpu_dot22scalar(node):
...
@@ -700,36 +699,6 @@ def local_gpu_dot22scalar(node):
return
False
return
False
@register_opt
()
@local_optimizer
([
gpu_from_host
,
slinalg
.
Solve
])
def
local_gpu_solve
(
node
):
"""
gpu_from_host(CpuSolve) -> GpuSolve(gpu_from_host)
CpuSolve(host_from_gpu) -> host_from_gpu(GpuSolve)
"""
if
node
.
outputs
[
0
]
.
dtype
!=
'float32'
:
return
if
isinstance
(
node
.
op
,
GpuFromHost
):
host_input
=
node
.
inputs
[
0
]
if
(
host_input
.
owner
and
isinstance
(
host_input
.
owner
.
op
,
slinalg
.
Solve
)):
x
,
y
=
host_input
.
owner
.
inputs
return
[
gpu_solve
(
as_cuda_ndarray_variable
(
x
),
as_cuda_ndarray_variable
(
y
))]
if
isinstance
(
node
.
op
,
slinalg
.
Solve
):
if
any
([
i
.
owner
and
isinstance
(
i
.
owner
.
op
,
HostFromGpu
)
for
i
in
node
.
inputs
]):
x
,
y
=
node
.
inputs
return
[
host_from_gpu
(
gpu_solve
(
as_cuda_ndarray_variable
(
x
),
as_cuda_ndarray_variable
(
y
)))]
return
False
@register_opt
()
@register_opt
()
@local_optimizer
([
gpu_from_host
,
tensor
.
blas_c
.
CGemv
,
tensor
.
blas
.
Gemv
])
@local_optimizer
([
gpu_from_host
,
tensor
.
blas_c
.
CGemv
,
tensor
.
blas
.
Gemv
])
def
local_gpu_gemv
(
node
):
def
local_gpu_gemv
(
node
):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论