Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
419bb056
提交
419bb056
authored
8月 10, 2016
作者:
sentient07
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Removed redundant WRITEME
上级
c3bc7b7d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
2 行增加
和
10 行删除
+2
-10
opt.py
theano/gof/opt.py
+2
-10
没有找到文件。
theano/gof/opt.py
浏览文件 @
419bb056
...
@@ -38,7 +38,6 @@ def _list_of_nodes(fgraph):
...
@@ -38,7 +38,6 @@ def _list_of_nodes(fgraph):
class
Optimizer
(
object
):
class
Optimizer
(
object
):
"""
"""
WRITEME
An L{Optimizer} can be applied to an L{FunctionGraph} to transform it.
An L{Optimizer} can be applied to an L{FunctionGraph} to transform it.
It can represent an optimization or in general any kind
It can represent an optimization or in general any kind
...
@@ -64,7 +63,6 @@ class Optimizer(object):
...
@@ -64,7 +63,6 @@ class Optimizer(object):
def
apply
(
self
,
fgraph
):
def
apply
(
self
,
fgraph
):
"""
"""
WRITEME
Applies the optimization to the provided L{FunctionGraph}. It may
Applies the optimization to the provided L{FunctionGraph}. It may
use all the methods defined by the L{FunctionGraph}. If the
use all the methods defined by the L{FunctionGraph}. If the
...
@@ -76,7 +74,6 @@ class Optimizer(object):
...
@@ -76,7 +74,6 @@ class Optimizer(object):
def
optimize
(
self
,
fgraph
,
*
args
,
**
kwargs
):
def
optimize
(
self
,
fgraph
,
*
args
,
**
kwargs
):
"""
"""
WRITEME
This is meant as a shortcut to:
This is meant as a shortcut to:
opt.add_requirements(fgraph)
opt.add_requirements(fgraph)
...
@@ -94,7 +91,6 @@ class Optimizer(object):
...
@@ -94,7 +91,6 @@ class Optimizer(object):
def
__call__
(
self
,
fgraph
):
def
__call__
(
self
,
fgraph
):
"""
"""
WRITEME
Same as self.optimize(fgraph).
Same as self.optimize(fgraph).
...
@@ -103,7 +99,6 @@ class Optimizer(object):
...
@@ -103,7 +99,6 @@ class Optimizer(object):
def
add_requirements
(
self
,
fgraph
):
def
add_requirements
(
self
,
fgraph
):
"""
"""
WRITEME
Add features to the fgraph that are required to apply the optimization.
Add features to the fgraph that are required to apply the optimization.
For example:
For example:
...
@@ -179,7 +174,6 @@ def inplace_optimizer(f):
...
@@ -179,7 +174,6 @@ def inplace_optimizer(f):
class
SeqOptimizer
(
Optimizer
,
list
):
class
SeqOptimizer
(
Optimizer
,
list
):
# inherit from Optimizer first to get Optimizer.__hash__
# inherit from Optimizer first to get Optimizer.__hash__
"""
"""
WRITEME
Takes a list of L{Optimizer} instances and applies them
Takes a list of L{Optimizer} instances and applies them
sequentially.
sequentially.
...
@@ -216,7 +210,6 @@ class SeqOptimizer(Optimizer, list):
...
@@ -216,7 +210,6 @@ class SeqOptimizer(Optimizer, list):
def
apply
(
self
,
fgraph
):
def
apply
(
self
,
fgraph
):
"""
"""
WRITEME
Applies each L{Optimizer} in self in turn.
Applies each L{Optimizer} in self in turn.
...
@@ -1297,6 +1290,8 @@ class LocalOptGroup(LocalOptimizer):
...
@@ -1297,6 +1290,8 @@ class LocalOptGroup(LocalOptimizer):
# This method is just kept for the `print_profile` method to know the variables that
# This method is just kept for the `print_profile` method to know the variables that
# needs to be printed
# needs to be printed
def
apply
(
self
):
def
apply
(
self
):
import
pdb
pdb
.
set_trace
()
return
(
self
.
time_opts
,
return
(
self
.
time_opts
,
self
.
time_nodes
,
self
.
time_nodes
,
self
.
node_created
,
self
.
node_created
,
...
@@ -1389,7 +1384,6 @@ class LocalOptGroup(LocalOptimizer):
...
@@ -1389,7 +1384,6 @@ class LocalOptGroup(LocalOptimizer):
class
OpSub
(
LocalOptimizer
):
class
OpSub
(
LocalOptimizer
):
"""
"""
WRITEME
Replaces the application of a certain op by the application of
Replaces the application of a certain op by the application of
another op that takes the same inputs as what they are replacing.
another op that takes the same inputs as what they are replacing.
...
@@ -1439,7 +1433,6 @@ class OpSub(LocalOptimizer):
...
@@ -1439,7 +1433,6 @@ class OpSub(LocalOptimizer):
class
OpRemove
(
LocalOptimizer
):
class
OpRemove
(
LocalOptimizer
):
"""
"""
WRITEME
Removes all applications of an op by transferring each of its
Removes all applications of an op by transferring each of its
outputs to the corresponding input.
outputs to the corresponding input.
...
@@ -1475,7 +1468,6 @@ class OpRemove(LocalOptimizer):
...
@@ -1475,7 +1468,6 @@ class OpRemove(LocalOptimizer):
class
PatternSub
(
LocalOptimizer
):
class
PatternSub
(
LocalOptimizer
):
"""
"""
WRITEME
@todo update
@todo update
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论