Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
3930793b
提交
3930793b
authored
2月 22, 2011
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
white space fix.
上级
00b39e52
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
10 行增加
和
9 行删除
+10
-9
opt.py
theano/sandbox/cuda/opt.py
+10
-9
没有找到文件。
theano/sandbox/cuda/opt.py
浏览文件 @
3930793b
...
@@ -11,9 +11,9 @@ from theano.gof import (local_optimizer, EquilibriumDB, SequenceDB, Optimizer,
...
@@ -11,9 +11,9 @@ from theano.gof import (local_optimizer, EquilibriumDB, SequenceDB, Optimizer,
from
theano.sandbox.cuda.basic_ops
import
*
from
theano.sandbox.cuda.basic_ops
import
*
from
theano.sandbox.cuda.type
import
CudaNdarrayType
from
theano.sandbox.cuda.type
import
CudaNdarrayType
from
theano.sandbox.cuda.blas
import
(
gpu_dot22
,
gpu_dot22scalar
,
from
theano.sandbox.cuda.blas
import
(
gpu_dot22
,
gpu_dot22scalar
,
gpu_gemm_inplace
,
gpu_gemm_no_inplace
,
GpuConv
)
gpu_gemm_inplace
,
gpu_gemm_no_inplace
,
GpuConv
)
from
theano.sandbox.cuda.blas
import
(
GpuDownsampleFactorMax
,
from
theano.sandbox.cuda.blas
import
(
GpuDownsampleFactorMax
,
GpuDownsampleFactorMaxGrad
)
GpuDownsampleFactorMaxGrad
)
from
theano.sandbox.cuda.nnet
import
(
from
theano.sandbox.cuda.nnet
import
(
GpuCrossentropySoftmaxArgmax1HotWithBias
,
GpuCrossentropySoftmaxArgmax1HotWithBias
,
...
@@ -21,16 +21,17 @@ from theano.sandbox.cuda.nnet import (
...
@@ -21,16 +21,17 @@ from theano.sandbox.cuda.nnet import (
GpuSoftmax
,
GpuSoftmaxWithBias
)
GpuSoftmax
,
GpuSoftmaxWithBias
)
from
theano.compile
import
optdb
from
theano.compile
import
optdb
from
theano.tensor.blas
import
_is_real_vector
,
_is_real_matrix
from
theano.tensor.blas
import
_is_real_vector
,
_is_real_matrix
#optdb.print_summary() # shows what is currently registered
#optdb.print_summary() # shows what is currently registered
gpu_optimizer
=
EquilibriumDB
()
gpu_optimizer
=
EquilibriumDB
()
gpu_cut_copies
=
EquilibriumDB
()
gpu_cut_copies
=
EquilibriumDB
()
gpu_seqopt
=
SequenceDB
()
gpu_seqopt
=
SequenceDB
()
gpu_seqopt
.
register
(
'gpu_local_optimizations'
,
gpu_optimizer
,
1
,
gpu_seqopt
.
register
(
'gpu_local_optimizations'
,
gpu_optimizer
,
1
,
'fast_run'
,
'inplace'
)
'fast_run'
,
'inplace'
)
gpu_seqopt
.
register
(
'gpu_cut_transfers'
,
gpu_cut_copies
,
2
,
gpu_seqopt
.
register
(
'gpu_cut_transfers'
,
gpu_cut_copies
,
2
,
'fast_run'
,
'inplace'
)
'fast_run'
,
'inplace'
)
optdb
.
register
(
'gpu'
,
optdb
.
register
(
'gpu'
,
gpu_seqopt
,
optdb
.
__position__
.
get
(
'add_destroy_handler'
,
49.5
)
-
1
)
gpu_seqopt
,
optdb
.
__position__
.
get
(
'add_destroy_handler'
,
49.5
)
-
1
)
# This second pass is needed as the fusion can put all the non float32 code
# This second pass is needed as the fusion can put all the non float32 code
# inside the elemwise. When it there is no float64 op, this is working.
# inside the elemwise. When it there is no float64 op, this is working.
...
@@ -44,7 +45,7 @@ def register_opt(*tags, **kwargs):
...
@@ -44,7 +45,7 @@ def register_opt(*tags, **kwargs):
return
local_opt
return
local_opt
return
f
return
f
#register local_track_shape_i at this level too
#register local_track_shape_i at this level too
#to make multi-level lift of shape work.
#to make multi-level lift of shape work.
register_opt
()(
theano
.
tensor
.
opt
.
local_track_shape_i
)
register_opt
()(
theano
.
tensor
.
opt
.
local_track_shape_i
)
...
@@ -115,7 +116,7 @@ def float64_in_elemwise(op):
...
@@ -115,7 +116,7 @@ def float64_in_elemwise(op):
return
True
return
True
return
False
return
False
@register_opt
()
@register_opt
()
...
@@ -806,7 +807,7 @@ def get_device_type_sizes():
...
@@ -806,7 +807,7 @@ def get_device_type_sizes():
"Got the following error, but we can ignore it. "
"Got the following error, but we can ignore it. "
"This could cause less GpuElemwise fused together.
\n
"
"This could cause less GpuElemwise fused together.
\n
"
"
%
s"
)
%
e
)
"
%
s"
)
%
e
)
rval
=
get_device_type_sizes
.
rval
=
locals
()
rval
=
get_device_type_sizes
.
rval
=
locals
()
return
rval
return
rval
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论