Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
202d7d39
提交
202d7d39
authored
4月 04, 2011
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean up import to have less stuff in the name space.
上级
b2669a40
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
7 行增加
和
14 行删除
+7
-14
__init__.py
theano/scan_module/__init__.py
+7
-14
没有找到文件。
theano/scan_module/__init__.py
浏览文件 @
202d7d39
...
@@ -37,7 +37,6 @@ __authors__ = ( "Razvan Pascanu "
...
@@ -37,7 +37,6 @@ __authors__ = ( "Razvan Pascanu "
__copyright__
=
"(c) 2010, Universite de Montreal"
__copyright__
=
"(c) 2010, Universite de Montreal"
__contact__
=
"Razvan Pascanu <r.pascanu@gmail>"
__contact__
=
"Razvan Pascanu <r.pascanu@gmail>"
import
itertools
import
logging
import
logging
import
numpy
import
numpy
import
sys
import
sys
...
@@ -45,12 +44,8 @@ import sys
...
@@ -45,12 +44,8 @@ import sys
from
theano
import
tensor
from
theano
import
tensor
from
theano.tensor
import
opt
,
TensorType
from
theano.tensor
import
opt
,
TensorType
from
theano
import
gof
from
theano
import
gof
from
theano.gof
import
Optimizer
,
toolbox
from
theano.compile
import
optdb
from
theano.compile
import
optdb
from
theano.compile.sharedvalue
import
SharedVariable
from
theano.configparser
import
AddConfigVar
,
BoolParam
from
theano
import
config
from
theano
import
config
from
theano.tensor
import
opt
import
scan_op
import
scan_op
from
scan
import
scan
from
scan
import
scan
...
@@ -90,13 +85,13 @@ optdb.register( 'scanOp_make_inplace'
...
@@ -90,13 +85,13 @@ optdb.register( 'scanOp_make_inplace'
class
ScanSaveMem
(
Optimizer
):
class
ScanSaveMem
(
gof
.
Optimizer
):
""" Graph Optimizer that reduces scan memory consumption """
""" Graph Optimizer that reduces scan memory consumption """
def
__init__
(
self
):
def
__init__
(
self
):
Optimizer
.
__init__
(
self
)
gof
.
Optimizer
.
__init__
(
self
)
def
add_requirements
(
self
,
env
):
def
add_requirements
(
self
,
env
):
env
.
extend
(
toolbox
.
ReplaceValidate
())
env
.
extend
(
gof
.
toolbox
.
ReplaceValidate
())
def
get_int_val
(
self
,
x
):
def
get_int_val
(
self
,
x
):
# int/constant
# int/constant
...
@@ -529,13 +524,13 @@ optdb.register( 'scanOp_save_mem'
...
@@ -529,13 +524,13 @@ optdb.register( 'scanOp_save_mem'
,
'fast_run'
)
,
'fast_run'
)
'''
'''
class ScanMerge(Optimizer):
class ScanMerge(
gof.
Optimizer):
""" Graph Optimizer that reduces scan memory consumption """
""" Graph Optimizer that reduces scan memory consumption """
def __init__(self):
def __init__(self):
Optimizer.__init__(self)
gof.
Optimizer.__init__(self)
def add_requirements(self,env):
def add_requirements(self,env):
env.extend(toolbox.ReplaceValidate())
env.extend(
gof.
toolbox.ReplaceValidate())
def merge(self, A,B):
def merge(self, A,B):
# Step 1. Identify common inputs
# Step 1. Identify common inputs
...
@@ -606,11 +601,9 @@ from theano.sandbox import cuda
...
@@ -606,11 +601,9 @@ from theano.sandbox import cuda
if
cuda
.
cuda_available
:
if
cuda
.
cuda_available
:
from
theano.sandbox.cuda.basic_ops
import
*
from
theano.sandbox.cuda.basic_ops
import
gpu_from_host
,
host_from_gpu
from
theano.sandbox.cuda.type
import
CudaNdarrayType
from
theano.sandbox.cuda.type
import
CudaNdarrayType
from
theano
import
sandbox
from
theano.sandbox.cuda.opt
import
register_opt
,
local_optimizer
from
theano.sandbox.cuda.opt
import
register_opt
,
local_optimizer
from
theano
import
config
def
safe_to_gpu
(
x
):
def
safe_to_gpu
(
x
):
if
(
isinstance
(
x
.
type
,
TensorType
)
and
if
(
isinstance
(
x
.
type
,
TensorType
)
and
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论