Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pytensor
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
testgroup
pytensor
Commits
7ce7b0c2
提交
7ce7b0c2
authored
7月 14, 2022
作者:
Brandon T. Willard
提交者:
Brandon T. Willard
8月 17, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Rename LocalMetaOptimizerSkipAssertionError to MetaNodeRewriterSkip
上级
0ba5c0a6
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
33 行增加
和
8 行删除
+33
-8
opt.py
aesara/graph/opt.py
+30
-5
opt.py
aesara/tensor/nnet/opt.py
+3
-3
没有找到文件。
aesara/graph/opt.py
浏览文件 @
7ce7b0c2
...
...
@@ -55,9 +55,9 @@ FailureCallbackType = Callable[
]
class
LocalMetaOptimizerSkipAssertionError
(
AssertionError
):
"""This is an
AssertionError
, but instead of having the
LocalMetaOptimizer
print the error, it just skip that
class
MetaNodeRewriterSkip
(
AssertionError
):
"""This is an
`AssertionError`
, but instead of having the
`LocalMetaOptimizer`
print the error, it just skip that
compilation.
"""
...
...
@@ -944,7 +944,7 @@ class LocalMetaOptimizer(LocalOptimizer):
Base class for meta-optimizers that try a set of `LocalOptimizer`\s
to replace a node and choose the one that executes the fastest.
If the error `
`LocalMetaOptimizerSkipAssertionError`
` is raised during
If the error `
MetaNodeRewriterSkip
` is raised during
compilation, we will skip that function compilation and not print
the error.
...
...
@@ -1016,7 +1016,7 @@ class LocalMetaOptimizer(LocalOptimizer):
)
fn
.
trust_input
=
True
timing
=
min
(
self
.
time_call
(
fn
)
for
_
in
range
(
2
))
except
LocalMetaOptimizerSkipAssertionError
:
except
MetaNodeRewriterSkip
:
continue
except
Exception
as
e
:
if
self
.
verbose
>
0
:
...
...
@@ -3052,3 +3052,28 @@ class CheckStackTraceOptimization(GlobalOptimizer):
def
apply
(
self
,
fgraph
):
pass
DEPRECATED_NAMES
=
[
(
"LocalMetaOptimizerSkipAssertionError"
,
"`LocalMetaOptimizerSkipAssertionError` is deprecated: use `MetaNodeRewriterSkip` instead."
,
MetaNodeRewriterSkip
,
),
]
def
__getattr__
(
name
):
"""Intercept module-level attribute access of deprecated symbols.
Adapted from https://stackoverflow.com/a/55139609/3006474.
"""
from
warnings
import
warn
for
old_name
,
msg
,
old_object
in
DEPRECATED_NAMES
:
if
name
==
old_name
:
warn
(
msg
,
DeprecationWarning
,
stacklevel
=
2
)
return
old_object
raise
AttributeError
(
f
"module {__name__} has no attribute {name}"
)
aesara/tensor/nnet/opt.py
浏览文件 @
7ce7b0c2
...
...
@@ -7,7 +7,7 @@ from aesara import compile
from
aesara.compile
import
optdb
from
aesara.configdefaults
import
config
from
aesara.graph.opt
import
(
LocalMetaOptimizerSkipAssertionError
,
MetaNodeRewriterSkip
,
TopoOptimizer
,
copy_stack_trace
,
in2out
,
...
...
@@ -583,8 +583,8 @@ def local_abstractconv_check(fgraph, node):
AbstractConv3d_gradInputs
,
),
):
raise
LocalMetaOptimizerSkipAssertionError
(
f
"{node.op.__class__.__name__} Aesara
optimization
failed: there is no implementation "
raise
MetaNodeRewriterSkip
(
f
"{node.op.__class__.__name__} Aesara
rewriting
failed: there is no implementation "
"available supporting the requested options. If on CPU, "
"do you have a BLAS library installed Aesara can link against? "
"On the CPU we do not support float16."
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论