Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
380fca03
提交
380fca03
authored
7月 19, 2022
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
8月 17, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename aesara.typed_list.opt to aesara.typed_list.rewriting
上级
8616d398
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
21 行增加
和
11 行删除
+21
-11
__init__.py
aesara/typed_list/__init__.py
+3
-3
rewriting.py
aesara/typed_list/rewriting.py
+3
-3
test_rewriting.py
tests/typed_list/test_rewriting.py
+15
-5
没有找到文件。
aesara/typed_list/__init__.py
浏览文件 @
380fca03
from
.
import
opt
from
.basic
import
*
from
.type
import
TypedListType
from
aesara.typed_list
import
rewriting
from
aesara.typed_list
.basic
import
*
from
aesara.typed_list
.type
import
TypedListType
aesara/typed_list/
opt
.py
→
aesara/typed_list/
rewriting
.py
浏览文件 @
380fca03
...
...
@@ -4,7 +4,7 @@ from aesara.typed_list.basic import Append, Extend, Insert, Remove, Reverse
@node_rewriter
([
Append
,
Extend
,
Insert
,
Reverse
,
Remove
],
inplace
=
True
)
def
typed_list_inplace_
opt
(
fgraph
,
node
):
def
typed_list_inplace_
rewrite
(
fgraph
,
node
):
if
(
isinstance
(
node
.
op
,
(
Append
,
Extend
,
Insert
,
Reverse
,
Remove
))
and
not
node
.
op
.
inplace
...
...
@@ -17,9 +17,9 @@ def typed_list_inplace_opt(fgraph, node):
optdb
.
register
(
"typed_list_inplace_
opt
"
,
"typed_list_inplace_
rewrite
"
,
WalkingGraphRewriter
(
typed_list_inplace_
opt
,
failure_callback
=
WalkingGraphRewriter
.
warn_inplace
typed_list_inplace_
rewrite
,
failure_callback
=
WalkingGraphRewriter
.
warn_inplace
),
"fast_run"
,
"inplace"
,
...
...
tests/typed_list/test_
opt
.py
→
tests/typed_list/test_
rewriting
.py
浏览文件 @
380fca03
...
...
@@ -17,7 +17,9 @@ class TestInplace:
)()
z
=
Reverse
()(
mySymbolicMatricesList
)
m
=
aesara
.
compile
.
mode
.
get_default_mode
()
.
including
(
"typed_list_inplace_opt"
)
m
=
aesara
.
compile
.
mode
.
get_default_mode
()
.
including
(
"typed_list_inplace_rewrite"
)
f
=
aesara
.
function
(
[
In
(
mySymbolicMatricesList
,
borrow
=
True
,
mutable
=
True
)],
z
,
...
...
@@ -38,7 +40,9 @@ class TestInplace:
)()
mySymbolicMatrix
=
matrix
()
z
=
Append
()(
mySymbolicMatricesList
,
mySymbolicMatrix
)
m
=
aesara
.
compile
.
mode
.
get_default_mode
()
.
including
(
"typed_list_inplace_opt"
)
m
=
aesara
.
compile
.
mode
.
get_default_mode
()
.
including
(
"typed_list_inplace_rewrite"
)
f
=
aesara
.
function
(
[
In
(
mySymbolicMatricesList
,
borrow
=
True
,
mutable
=
True
),
...
...
@@ -66,7 +70,9 @@ class TestInplace:
)()
z
=
Extend
()(
mySymbolicMatricesList1
,
mySymbolicMatricesList2
)
m
=
aesara
.
compile
.
mode
.
get_default_mode
()
.
including
(
"typed_list_inplace_opt"
)
m
=
aesara
.
compile
.
mode
.
get_default_mode
()
.
including
(
"typed_list_inplace_rewrite"
)
f
=
aesara
.
function
(
[
In
(
mySymbolicMatricesList1
,
borrow
=
True
,
mutable
=
True
),
...
...
@@ -91,7 +97,9 @@ class TestInplace:
mySymbolicMatrix
=
matrix
()
z
=
Insert
()(
mySymbolicMatricesList
,
mySymbolicIndex
,
mySymbolicMatrix
)
m
=
aesara
.
compile
.
mode
.
get_default_mode
()
.
including
(
"typed_list_inplace_opt"
)
m
=
aesara
.
compile
.
mode
.
get_default_mode
()
.
including
(
"typed_list_inplace_rewrite"
)
f
=
aesara
.
function
(
[
...
...
@@ -117,7 +125,9 @@ class TestInplace:
)()
mySymbolicMatrix
=
matrix
()
z
=
Remove
()(
mySymbolicMatricesList
,
mySymbolicMatrix
)
m
=
aesara
.
compile
.
mode
.
get_default_mode
()
.
including
(
"typed_list_inplace_opt"
)
m
=
aesara
.
compile
.
mode
.
get_default_mode
()
.
including
(
"typed_list_inplace_rewrite"
)
f
=
aesara
.
function
(
[
In
(
mySymbolicMatricesList
,
borrow
=
True
,
mutable
=
True
),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论