Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
5e8398b5
提交
5e8398b5
authored
2月 14, 2022
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
2月 22, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update OptimizationQuery's docstrings
上级
4e0fcb7d
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
13 行增加
和
12 行删除
+13
-12
optdb.py
aesara/graph/optdb.py
+13
-12
没有找到文件。
aesara/graph/optdb.py
浏览文件 @
5e8398b5
...
@@ -194,19 +194,19 @@ class OptimizationQuery:
...
@@ -194,19 +194,19 @@ class OptimizationQuery:
==========
==========
include:
include:
A set of tags such that every optimization obtained through this
A set of tags such that every optimization obtained through this
`
`OptimizationQuery`
` must have **one** of the tags listed. This
`
OptimizationQuery
` must have **one** of the tags listed. This
field is required and basically acts as a starting point for the
field is required and basically acts as a starting point for the
search.
search.
require:
require:
A set of tags such that every optimization obtained through this
A set of tags such that every optimization obtained through this
`
`OptimizationQuery`
` must have **all** of these tags.
`
OptimizationQuery
` must have **all** of these tags.
exclude:
exclude:
A set of tags such that every optimization obtained through this
A set of tags such that every optimization obtained through this
``OptimizationQuery`
`
must have **none** of these tags.
``OptimizationQuery` must have **none** of these tags.
subquery:
subquery:
A dictionary mapping the name of a sub-database to a special
A dictionary mapping the name of a sub-database to a special
`
`OptimizationQuery`
`. If no subquery is given for a sub-database,
`
OptimizationQuery
`. If no subquery is given for a sub-database,
the original `
`OptimizationQuery`
` will be used again.
the original `
OptimizationQuery
` will be used again.
position_cutoff:
position_cutoff:
Only optimizations with position less than the cutoff are returned.
Only optimizations with position less than the cutoff are returned.
extra_optimizations:
extra_optimizations:
...
@@ -241,8 +241,8 @@ class OptimizationQuery:
...
@@ -241,8 +241,8 @@ class OptimizationQuery:
if
not
hasattr
(
self
,
"extra_optimizations"
):
if
not
hasattr
(
self
,
"extra_optimizations"
):
self
.
extra_optimizations
=
[]
self
.
extra_optimizations
=
[]
# add all opt with this tag
def
including
(
self
,
*
tags
:
str
)
->
"OptimizationQuery"
:
def
including
(
self
,
*
tags
):
"""Add rewrites with the given tags."""
return
OptimizationQuery
(
return
OptimizationQuery
(
self
.
include
.
union
(
tags
),
self
.
include
.
union
(
tags
),
self
.
require
,
self
.
require
,
...
@@ -252,8 +252,8 @@ class OptimizationQuery:
...
@@ -252,8 +252,8 @@ class OptimizationQuery:
self
.
extra_optimizations
,
self
.
extra_optimizations
,
)
)
# remove all opt with this tag
def
excluding
(
self
,
*
tags
:
str
)
->
"OptimizationQuery"
:
def
excluding
(
self
,
*
tags
):
"""Remove rewrites with the given tags."""
return
OptimizationQuery
(
return
OptimizationQuery
(
self
.
include
,
self
.
include
,
self
.
require
,
self
.
require
,
...
@@ -263,8 +263,8 @@ class OptimizationQuery:
...
@@ -263,8 +263,8 @@ class OptimizationQuery:
self
.
extra_optimizations
,
self
.
extra_optimizations
,
)
)
# keep only opt with this tag.
def
requiring
(
self
,
*
tags
:
str
)
->
"OptimizationQuery"
:
def
requiring
(
self
,
*
tags
):
"""Filter for rewrites with the given tags."""
return
OptimizationQuery
(
return
OptimizationQuery
(
self
.
include
,
self
.
include
,
self
.
require
.
union
(
tags
),
self
.
require
.
union
(
tags
),
...
@@ -274,7 +274,8 @@ class OptimizationQuery:
...
@@ -274,7 +274,8 @@ class OptimizationQuery:
self
.
extra_optimizations
,
self
.
extra_optimizations
,
)
)
def
register
(
self
,
*
optimizations
):
def
register
(
self
,
*
optimizations
:
Sequence
[
OptimizersType
])
->
"OptimizationQuery"
:
"""Include the given optimizations."""
return
OptimizationQuery
(
return
OptimizationQuery
(
self
.
include
,
self
.
include
,
self
.
require
,
self
.
require
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论