Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
92362104
提交
92362104
authored
11月 21, 2014
作者:
Frederic
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix recursive import. Do not make dnn import opt. opt stil import dnn
上级
aa892a7e
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
19 行增加
和
13 行删除
+19
-13
__init__.py
theano/sandbox/cuda/__init__.py
+17
-0
dnn.py
theano/sandbox/cuda/dnn.py
+1
-1
opt.py
theano/sandbox/cuda/opt.py
+1
-12
没有找到文件。
theano/sandbox/cuda/__init__.py
浏览文件 @
92362104
...
@@ -9,11 +9,28 @@ import sys
...
@@ -9,11 +9,28 @@ import sys
import
theano
import
theano
from
theano.compat
import
get_unbound_function
from
theano.compat
import
get_unbound_function
from
theano.compile
import
optdb
from
theano.compile
import
optdb
from
theano.gof
import
EquilibriumDB
from
theano.gof.cmodule
import
get_lib_extension
from
theano.gof.cmodule
import
get_lib_extension
from
theano.gof.compilelock
import
get_lock
,
release_lock
from
theano.gof.compilelock
import
get_lock
,
release_lock
from
theano.configparser
import
config
,
AddConfigVar
,
StrParam
,
BoolParam
from
theano.configparser
import
config
,
AddConfigVar
,
StrParam
,
BoolParam
import
nvcc_compiler
import
nvcc_compiler
# ignore_newtrees is to speed the optimization as this is the pattern
# we use for optimization. Otherwise, we can iterate 100s of time on
# the graph and apply only a few optimizations each time.
gpu_optimizer
=
EquilibriumDB
(
ignore_newtrees
=
False
)
def
register_opt
(
*
tags
,
**
kwargs
):
def
f
(
local_opt
):
name
=
(
kwargs
and
kwargs
.
pop
(
'name'
))
or
local_opt
.
__name__
gpu_optimizer
.
register
(
name
,
local_opt
,
'fast_run'
,
'fast_compile'
,
'gpu'
,
*
tags
)
return
local_opt
return
f
_logger_name
=
'theano.sandbox.cuda'
_logger_name
=
'theano.sandbox.cuda'
_logger
=
logging
.
getLogger
(
_logger_name
)
_logger
=
logging
.
getLogger
(
_logger_name
)
...
...
theano/sandbox/cuda/dnn.py
浏览文件 @
92362104
...
@@ -13,7 +13,7 @@ from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable,
...
@@ -13,7 +13,7 @@ from theano.sandbox.cuda.basic_ops import (as_cuda_ndarray_variable,
from
theano.sandbox.cuda.blas
import
(
GpuConv
,
GpuDownsampleFactorMax
,
from
theano.sandbox.cuda.blas
import
(
GpuConv
,
GpuDownsampleFactorMax
,
GpuDownsampleFactorMaxGrad
)
GpuDownsampleFactorMaxGrad
)
from
theano.sandbox.cuda.nnet
import
GpuSoftmax
from
theano.sandbox.cuda.nnet
import
GpuSoftmax
from
theano.sandbox.cuda
.opt
import
register_opt
from
theano.sandbox.cuda
import
register_opt
from
theano.sandbox.cuda.nvcc_compiler
import
NVCC_compiler
from
theano.sandbox.cuda.nvcc_compiler
import
NVCC_compiler
...
...
theano/sandbox/cuda/opt.py
浏览文件 @
92362104
...
@@ -42,6 +42,7 @@ from theano.sandbox.cuda.elemwise import SupportCodeError
...
@@ -42,6 +42,7 @@ from theano.sandbox.cuda.elemwise import SupportCodeError
from
theano.scalar.basic_scipy
import
Erfinv
from
theano.scalar.basic_scipy
import
Erfinv
from
theano.sandbox.cuda.elemwise
import
erfinv_gpu
from
theano.sandbox.cuda.elemwise
import
erfinv_gpu
from
theano.sandbox.cuda.var
import
CudaNdarrayConstant
from
theano.sandbox.cuda.var
import
CudaNdarrayConstant
from
theano.sandbox.cuda
import
gpu_optimizer
,
register_opt
from
theano.scan_module
import
scan_utils
,
scan_op
,
scan_opt
from
theano.scan_module
import
scan_utils
,
scan_op
,
scan_opt
from
theano.tensor.blas
import
_is_real_vector
,
_is_real_matrix
from
theano.tensor.blas
import
_is_real_vector
,
_is_real_matrix
from
theano.tensor
import
nlinalg
from
theano.tensor
import
nlinalg
...
@@ -56,10 +57,6 @@ except ImportError:
...
@@ -56,10 +57,6 @@ except ImportError:
#optdb.print_summary() # shows what is currently registered
#optdb.print_summary() # shows what is currently registered
#ignore_newtrees is to speed the optimization as this is the pattern
#we use for optimization. Otherwise, we can iterate 100s of time on
#the graph and apply only a few optimizations each time.
gpu_optimizer
=
EquilibriumDB
(
ignore_newtrees
=
False
)
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
,
...
@@ -84,14 +81,6 @@ gpu_optimizer.register('gpu_merge', theano.gof.opt.merge_optimizer,
...
@@ -84,14 +81,6 @@ gpu_optimizer.register('gpu_merge', theano.gof.opt.merge_optimizer,
'fast_run'
,
'fast_compile'
)
'fast_run'
,
'fast_compile'
)
def
register_opt
(
*
tags
,
**
kwargs
):
def
f
(
local_opt
):
name
=
(
kwargs
and
kwargs
.
pop
(
'name'
))
or
local_opt
.
__name__
gpu_optimizer
.
register
(
name
,
local_opt
,
'fast_run'
,
'fast_compile'
,
'gpu'
,
*
tags
)
return
local_opt
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
)
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论