Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
4bcb0779
提交
4bcb0779
authored
10月 29, 2009
作者:
Frederic Bastien
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
if the env variable THEANO_FLAGS have the token local_elemwise_fusion we enable…
if the env variable THEANO_FLAGS have the token local_elemwise_fusion we enable the fusion. Each token is separated by comma.
上级
cdffaa87
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
12 行增加
和
5 行删除
+12
-5
opt.py
theano/tensor/opt.py
+12
-5
没有找到文件。
theano/tensor/opt.py
浏览文件 @
4bcb0779
...
...
@@ -14,7 +14,7 @@ import inplace as I
import
numpy
as
N
import
operator
import
itertools
import
sys
import
sys
,
os
from
theano
import
compile
#to register the optimizer built by this file
from
theano.gof.python25
import
any
,
all
...
...
@@ -1237,8 +1237,7 @@ def local_elemwise_fusion(node):
The number of dimension is validated at call time by theano itself.
TODO:The broadcast flag?
"""
# TODO:implement Composite.__eq__ by using CLinker.cmodule_key() to compare the graph.
#TODO: Merge when nb_clients>1? When this optimisation could introduce duplication of computation? When this will be faster?
#TODO: Merge with multiple output to merge when an inputs have multiple clients. This can't be done with a local optimiser.
if
not
isinstance
(
node
.
op
,
T
.
Elemwise
):
return
False
...
...
@@ -1305,8 +1304,16 @@ def local_elemwise_fusion(node):
# print "local_elemwise_fusion: FUSED",nb_elemwise+1,"elemwise!"
return
n
.
outputs
#register_specialize(local_elemwise_fusion)
flags
=
os
.
getenv
(
'THEANO_FLAGS'
,
None
)
if
flags
:
flags
=
flags
.
split
(
','
)
if
'local_elemwise_fusion'
in
flags
:
print
"Will fusion elemwise"
register_specialize
(
local_elemwise_fusion
)
else
:
print
"Won't fuse elemwise"
# def make_composite(inputs, outputs):
# scalar_inputs = [scalar.Scalar(dtype = i.type.dtype)() for i in inputs]
# def transform(r):
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论